Hi,
I have the following task in an Ansible playbook :
- name: Create MariaDB users and grant privileges
community.mysql.mysql_user:
name: "{{item.user}}"
password: "{{item.password}}"
priv: "{{item.name}}.*:ALL"
login_unix_socket: /var/run/mysqld/mysqld.sock
column_case_sensitive: true
state: present
loop: "{{mariadb_databases}}"
no_log: true
The playbook sets up a MariaDB database server, creates initial MariaDB users, etc.
Now the task in itself works. The problem is, it’s not idempotent, e. g. it reports a change every time the playbook is executed.
Any idea how to make this task idempotent ?