On Thursday, 26 January 2017 07:50:39 UTC, Michael Shi wrote:
>
> Is there really no better way to do it? While Leo's method works it's 
> extremely ugly to look at nor easily reusable. 
>

Would this help you?

- name: do something
  shell: do task
  when: ansible_local[foo] is defined

Instead of using ansible_local (which holds local facts), you could also 
use:

vars
hostvars

both of them are dictionaries with key/value pairs.

More info - http://docs.ansible.com/ansible/playbooks_variables.html

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/94165416-8f10-4b5d-b04b-6b5c789785c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to