Closed kevinold closed 10 years ago
Disregard it seems my mysql_db config wasn't an array. Closing.
I'm having the same problem, except that I'm not able to use "none" for the mysql_db as in the example.
- hosts: all
roles:
- {role: mysql, root_db_pass: foobar, mysql_db: none, mysql_users: none }
The my.cnf.RedHat.j2 here https://github.com/bennojoy/mysql/blob/master/templates/my.cnf.RedHat.j2 seems not to be able to handle "none" as input:
{% for i in mysql_db %}
{% if i.replicate|default(1) %}
binlog_do_db = {{ i.name }}
{% endif %}
{% endfor %}
Error output:
TASK: [mysql | Copy the my.cnf file] ******************************************
fatal: [dev-database-03-jt] => {'msg': "One or more undefined variables: 'str object' has no attribute 'name'", 'failed': True}
fatal: [dev-database-03-jt] => {'msg': "One or more undefined variables: 'str object' has no attribute 'name'", 'failed': True}
FATAL: all hosts have already failed -- aborting
This works if I put in a single database:
- {role: mysql, mysql_root_db_pass: 99d2dfdv, mysql_db: [name: ansible_DB], mysql_users: none }
Instead of "none" use "[]"
- {
role: bennojoy.mysql,
mysql_root_db_pass: password,
mysql_db: [],
mysql_users: [],
mysql_repl_user: []
}
I keep receiving the following error for the Copy my.cnf file task:
This output is with the -v flag, but I'm still not sure what the issue is.