I am getting to create a zabbix database using ansible.
The error I keep getting is;
fatal: [192.168.253.160]: FAILED! => {“changed”: false, “msg”: “unable to find /root/.my.cnf. Exception message: (1698, “Access denied for user ‘root’@’localhost'”)”}
YML below, can you help?
-
name: Ensure Zabbix database exists
mysql_db:
name: zabbix
state: present
collation: utf8mb4_bin
encoding: utf8mb4
login_user: root
login_password: *******-
name: Ensure MySQL user exists and has privileges
mysql_user:
name: zabbix
password: password
host: “localhost”
priv: ‘zabbix.*:ALL,GRANT’
state: present
login_user: root
login_password: ******* #root_password -
name: Set global MySQL variable for function creators
mysql_variables:
login_user: root
login_password: ******* #root_password
variable: log_bin_trust_function_creators
value: 1 -
name: Ensure MySQL is restarted to apply changes
systemd:
name: mysql
state: restarted
-
I tried to modify the file /etc/mysql/my.cnf
nefzi ines is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.