I'll answer myself... Am 06.03.16 schrieb Johannes Kastl:
> How to run this task is ssh_users is not defined in the hostvars?
>
> when: "{{ ssh_users|default([X]) }} == X"
For the next one searching (may be me if I forget how I did it...):
################
- name: This runs if ssh_users is not set
copy:
src='...'
dest='...'
when: ssh_users is undefined
- name: This runs if there is something ssh_users
copy:
src='...'
dest='...'
with_items: "{{ ssh_users|default([1]) }}"
when: ssh_users is defined
################
Note the 1 inside the default in the second task. If I leave this
empty ...|default([]) ... there is no hint if this task is skipped.
Brian, is this somehow like it is supposed to be? Or is this breaking
in a future release of ansible?
Johannes
--
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/56DC7886.6080508%40ojkastl.de.
For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: OpenPGP digital signature
