Hi Ian,

On Thu, Jan 18, 2024 at 11:47:46AM +0700, Ian Hobson wrote:
>   community.mysql.mysql_user:
>     user: backup
>     host: localhost
>     login_password: <redacted>
>     priv: '*.*:SELECT, PROCESS, LOCK TABLES'
> 
> The error message is:
> fatal: [ubuntu2004.hcs]: FAILED! => {"changed": false, "msg": "invalid
> privileges string: Invalid privileges specified: frozenset({' PROCESS, LOCK
> TABLES'})"}
> 
> I can see nothing wrong with the priv line. Can someone spot it?

I've found the format of the mysql privileges to be extremely picky.
Aside from having to get the syntax correct, also look out for it
seeing privileges in a different order, so applying them again at
every run.

I found that whole-table privileges required no space between, while
column-based privs need spaces between. Example:

priv:
  "somedb.sometable":  "SELECT,INSERT,UPDATE,DELETE"
  "somedb.othertable": "SELECT (ID, ACOL, BCOL),\
                       INSERT"

If you run ansible with two or three -v you'll see the MySQL
commands it executes so you can check what it's doing.

Thanks,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/Zak/yylUSqH5W8IX%40mail.bitfolk.com.

Reply via email to