Ah, misinterpreted what you wanted, just put the if inside the for and
base it on the hostvar

{% for i in play_hosts | sort %}
{% if hostvars[i]['chrony'] is changed %}
Host: {{ i }}
chronyd state: {{ hostvars[i]['chrony']['state'] }}
{% endif %}
{% endfor %}

But you should really move to a 2nd play on hosts: localhost so you
wont send report X number of hosts that changed
----------
Brian Coca

-- 
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/CACVha7cjAmEAPja2oKuOyf_nsiWBVfjN50KZ9Ch_5PCoOp%3D_fQ%40mail.gmail.com.

Reply via email to