The warning is:
[WARNING]: when statements should not include jinja2 templating delimiters
such as {{ }} or {% %}.
Not sure how to avoid it in the below case. Any hint ?
See https://github.com/ansible/ansible/issues/22397. Sorry for commenting
in a closed issue
consider the following variable:
to_be_removed_users:
- name: 'adm'
remove: False
- name: 'ftp'
remove: True
- name: 'games'
remove: False
- name: 'gopher'
remove: True
- name: 'operator'
remove: False
- name: 'uucp'
remove: True
then the following tasks generate the warning. Not sure how to avoid it as
item.name is the result of iteration on the list
name: Get users list
getent:
database: passwd
tags:
- userdel
- name: Make sure the following users are removed
user:
name: "{{ item.name }}"
state: absent
remove: "{{item.remove}}"
with_items: '{{ to_be_removed_users }}'
when: getent_passwd.{{ item.name }} is defined
tags:
- userdel
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAB1FMuSpS4VKk80KQXdJku6GJdWHrKQQQ4tJLqbLZmEXcbaeTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.