Hi all!
I am new in Ansible and this Group, so thanks in advance for the patience and help.
I’m writing a Playbook Roles for install and setup MySQL RDBMS on Linux (CentOS), and I get an error with the template module when ansible parses the my.cnf.j2.
Here the msg err
TASK [mysql : Copy my.cnf global MySQL configuration.] *************************
task path: /opt/settings/ansible/roles/mysql/tasks/configure.yml:2
fatal: [v1080udesa]: FAILED! => {“changed”: false, “failed”: true, “invocation”: {“module_args”: {“dest”: “/etc/my.cnf”, “group”: “root”, “mode”: “0644”, “owner”: “root”, “src”: “my.cnf.j2”}, “module_name”: “template”}, “msg”: “AnsibleUndefinedVariable: Unable to look up a name or access an attribute in template string (# The MySQL database server configuration file.\n [ cut output for sanity ] key_buffer\t\t\t= 64M\n\n).\nMake sure your variable name does not contain invalid characters like ‘-’: unsupported operand type(s) for -: ‘StrictUndefined’ and ‘StrictUndefined’”}
to retry, use: --limit @install_mysql.retry
PLAY RECAP *********************************************************************
I’m refurbishing one Role from Ansible-Galaxy, so I think that this works already for others DBAs. (but i don’t know if this version work)
I searched several roles on Galaxy and all users have the same template command and similar template file.
In addition, I leave the link: https://galaxy.ansible.com/geerlingguy/mysql/
Could someone help me to find if it is an error with the playbook or a version bug?
Regards!