Found the problem.

The comma separated list of privileges, cannot have spaces after the commas.

This is unusually user-hostile!

Regards

Ian

On 18/01/2024 11:47, Ian Hobson wrote:
Hi All,

I am attempting to use Ansible to create a MySQL backup user. It should be able to read and lock tables for everything. The step in the playbook is this.

- name: create user - GRANT SELECT, PROCESS, LOCK TABLES ON *.* TO `backup`@`localhost`
   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 suggest someth

Regards

Ian


--
Ian Hobson
Tel (+66) 626 544 695

--
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/49c1c8b0-dfc3-4ad4-9096-f450445c6339%40gmail.com.

Reply via email to