[ansible-project] Options for filtering hosts

2019-01-23 Thread Adam E
If you happen to be using awx, you can enable fact caching and then create a 
dynamic inventory which can be based on search results including facts values

-- 
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/10f4a59d-6c8f-4419-931b-e50e789361f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Options for filtering hosts

2019-01-23 Thread S C Rigler
We have a static inventory where hosts are grouped by location and
purpose.  I was wondering if there was a way to limit a playbook run
to hosts based on cached facts as a criteria (like only run on rhel 7
hosts, or only run on virtual hosts, etc).  I know I can put the tasks
in a block with a "when" clause to have it only run on hosts that
match the criteria, but it still has to iterate through every host to
decide which to include (which isn't efficient with a large inventory
where only 10% of the hosts might match the criteria).  Any
suggestions?

Thanks,
Steve

-- 
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/CAFbiokcKMnNhc_iA_WgB1KUZMogXj4sC0VC2fkPCD%2BsNfqrbwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.