fix ''dict object has no attribute dict_keys" issue with python3 (#578)
In Python2, the dict.keys(), dict.values(), and dict.items() methods returns a list. Jinja2 returns that to Ansible via a string representation that Ansible can turn back into a list. In Python3, those methods return a dictionary view object. resource: https://docs.ansible.com/ansible/2.4/playbooks_python_version.html#dictionary-views
This commit is contained in:
parent
b137ebd6ec
commit
5b1d028bd2
3 changed files with 16 additions and 16 deletions
|
|
@ -22,8 +22,8 @@
|
|||
- es_api_basic_auth_password is not defined
|
||||
|
||||
- name: set fact file_reserved_users
|
||||
set_fact: file_reserved_users={{ es_users.file.keys() | intersect (reserved_xpack_users) }}
|
||||
when: es_users is defined and es_users.file is defined and (es_users.file.keys() | length > 0) and (es_users.file.keys() | intersect (reserved_xpack_users) | length > 0)
|
||||
set_fact: file_reserved_users={{ es_users.file.keys() | list | intersect (reserved_xpack_users) }}
|
||||
when: es_users is defined and es_users.file is defined and (es_users.file.keys() | list | length > 0) and (es_users.file.keys() | list | intersect (reserved_xpack_users) | length > 0)
|
||||
|
||||
- name: fail when changing users through file realm
|
||||
fail:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue