I have the following assert that works when I specify a single user in my
variable/list 'username'. If I change my variable to a list of names, this
fails, but I don't understand how to fix it. I have tried multiple things
(ie with_items), but nothing is working for me. I am sure I just have
syntax issues. Could use some guidance.
- assert:
that: ansible_facts.getent_passwd[user] != none
fail_msg: User doesn't exist
success_msg: Users exists
failed_when: false
when: not remove_user
Failure with list:
FAILED! => {"msg": "The conditional check
'ansible_facts.getent_passwd[user] != none' failed. The error was: error
while evaluating conditional (ansible_facts.getent_passwd[user] != none):
'user' is undefined"}
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/35fd6cb7-174b-484d-9be3-074f11ccee82n%40googlegroups.com.