bertvv / ansible-role-mariadb

Install MariaDB on RHEL/CentOS 7 or Fedora.
https://galaxy.ansible.com/bertvv/mariadb/
Other
145 stars 108 forks source link

python3 and ansible cause error #26

Closed brutallino closed 4 years ago

brutallino commented 5 years ago

When use ansible and python3:

TASK [bertvv.mariadb : Install custom config file]
fatal: [stage-catalog.megadepotllc.com]: FAILED! => changed=false 
   msg: 'AnsibleUndefinedVariable: ''dict object'' has no attribute ''iteritems'''

my ansible:

ansible 2.8.1
  config file = /home/user/project/server/ansible/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.7.3 (default, May 11 2019, 00:45:16) [GCC 8.3.1 20190223 (Red Hat 8.3.1-2)]

ansible.cfg:

[defaults]
gathering = smart

callback_whitelist = timer, profile_tasks
stdout_callback = yaml
show_custom_stats = yes
retry_files_enabled = False

[ssh_connection]
pipelining = True
control_path = /tmp/ansible-ssh-%%h-%%p-%%r

#fact_caching = yaml
#fact_caching_connection = ../../runtime/ansible
#fact_caching_timeout = 86400

FIX: bertvv.mariadb/templates/etc_my.cnf.d_custom.cnf.j2: change mariadb_custom_cnf.iteritems() to mariadb_custom_cnf.items() and section_contents.iteritems() to section_contents.items()

bertvv commented 4 years ago

In the current trunk branch, these changes are incorporated. I will be releasing a new version based on recent changes shortly. I should also add the variable mariadb_custom_cnf to the test playbook to ensure this bug is catched. I'm going to close this issue for now, but if you see the same problem in the new version, don't hesitate to reopen.