Am Donnerstag, 12. Oktober 2017 12:36:52 UTC+2 schrieb Goetz Leupold:
>
>
>> Instead of
>> - debug:
>> msg: "{{ item.item }}"
>> with_items: "{{ sshKey | json_query(query) }}"
>> vars:
>> query: "results[?changed==true]"
>>
>> You can use this
>>
>> - debug:
>> msg: "{{ item.item }}"
>> with_items: '{{ sshKey.results }}'
>> when: item.changed
>>
>> --
>> Kai Stian Olstad
>>
>
> Thank you a lot. Sometimes i dont see the forest for the trees ;) But
> nevertheless i am unhappy i cant use the json_query filter on that. I
> neither know if it is a bug or my bad.
>
Sorry, but your suggested solution doesnt cover my request full:
- debug:
msg: "{{ item.item }}"
with_items: "{{ sshKey.results }}"
when:
- sshKey.changed
- debug:
msg: "{{ item.item }}"
with_items: "{{ sshKey.results }}"
when:
- not sshKey.changed
The conditional isnt based on the results.(item).changed. It is based on
"sshKey.changed" and if one of the keys has changed, it is for every item
true.
Is it possible to take the actual item in the when clause?
--
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/d56ffc9e-9f02-44ee-98c2-b7f31e6d8009%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.