jhnferraris
jhnferraris

Reputation: 1401

Ansible 2.0 backslash issue

I'm having issues with backslash in Ansible 2.0

  mysql_user: name=someName
          password=somePassword
          priv=db.*:DELETE,INSERT,SELECT,UPDATE,LOCK\\ TABLES
          state=present

The error is:

"msg": "invalid privileges string: Invalid privileges specified: frozenset(['LOCK\\\\\\\\ TABLES'])"}

I tried a single backslash priv=db.*:DELETE,INSERT,SELECT,UPDATE,LOCK\ TABLES but no joy.

Any thoughts on this?

Thanks!

Upvotes: 1

Views: 176

Answers (1)

Konstantin Suvorov
Konstantin Suvorov

Reputation: 68269

You can't use spaces in unquoted strings with param=value syntax in Ansible.

mysql_user: name=someName
            password=somePassword
            priv="db.*:DELETE,INSERT,SELECT,UPDATE,LOCK TABLES"
            state=present

Advice: use dict-like parameters passing for complex arguments.

Upvotes: 1

Related Questions