On 12.10.2017 13:35, Goetz Leupold wrote:
Am Donnerstag, 12. Oktober 2017 12:36:52 UTC+2 schrieb Goetz Leupold:
You can use this

   - debug:
       msg: "{{ item.item }}"
     with_items: '{{ sshKey.results }}'
     when: item.changed


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?

Well, my example did, if you check it you'll see "when: item.changed".

--
Kai Stian Olstad

--
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/ebe534a801423dc19e9e1f31b5a3825f%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to