geerlingguy / ansible-role-varnish

Ansible Role - Varnish HTTP accelerator
https://galaxy.ansible.com/geerlingguy/varnish/
MIT License
80 stars 88 forks source link

AnsibleUndefinedVariable: dict object has no attribute iteritems #82

Closed AlbanAndrieu closed 6 years ago

AlbanAndrieu commented 6 years ago

iteritems is not working. Tested on Ubuntu 16.04, ansible 2.5.0


This change is Reviewable

geerlingguy commented 6 years ago

Have you tried on Ansible 2.6.x? I have been testing in 2.4 and 2.6 and haven't seen an issue. Could be an issue with the specific version (2.5.0) that you're using, as there were a number of weird issues resolved in 2.5.1 and 2.5.2...

geerlingguy commented 6 years ago

Ah... you might also be running Python 3. See related: https://github.com/geerlingguy/ansible-role-munin-node/pull/15

geerlingguy commented 6 years ago

Also, I'm thinking of just switching from .iteritems() to .items() | list, which makes for far fewer lines of code changed.

geerlingguy commented 6 years ago

Please see: https://github.com/geerlingguy/ansible-role-varnish/commit/98f7725be47471cb10a19bdb2252c562be8d8540

This was released in 2.3.1.

AlbanAndrieu commented 6 years ago

Thanks