ahuffman / ansible-sudoers

Controls the configuration of the default /etc/sudoers file and included files/directories.
MIT License
108 stars 45 forks source link

Ansible 2.5 slice filter error #24

Closed dobrozhanskyi closed 6 years ago

dobrozhanskyi commented 6 years ago

TASK [ansible-sudoers : Ensure the sudoers file is valid and up to date (separate specs)] **** fatal: [mngt.us.dcapi.net]: FAILED! => {"changed": false, "msg": "AnsibleFilterError: The slice filter requires a mapping to operate on, got a <type 'list'>."}

DeLoWaN commented 6 years ago

Same here. @dobrozhanskyi got this using python2.

With python3.5.2, I get this kind of error:

TASK [ansible-sudoers : Ensure the sudoers file is valid and up to date (separate specs)] ***************************
fatal: [preprod.iwd.fr]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'iteritems'"}

I tried with different versions of ansible from 2.3 to 2.5 with the same results. Do you guys have any idea?

Note that all was fine with ansible 2.4.2.

kuch4r commented 6 years ago

There is issue for this in Ansible: https://github.com/ansible/ansible/issues/37890

CafeLungo commented 6 years ago

I am now running into this, on Ansible 2.5.0

sebPomme commented 6 years ago

You can uptdate your ansible version the slice bug is fixed in version 2.5.2 https://github.com/ansible/ansible/pull/37944 (its work for me)

ahuffman commented 6 years ago

Fixed with Ansible 2.5.2. Thanks for validating @sebPomme and mentioning the Ansible core issue @kuch4r . Appreciate it. :1st_place_medal: