select hosts via multiple && tags

44 views
Skip to first unread message

Mark Olliver

unread,
Feb 2, 2015, 4:57:35 PM2/2/15
to ansible...@googlegroups.com
Hi,

I am using the AWS inventory script but I need a way to select groups of hosts based on a shared set of tags. I.e many hosts might share the same Project tag but of that group only a few would share the same Product tag however, the Product tag may also contain some hosts from other Projects.

As such I need the hosts which I am acting on to be a subset of these two (actually i am basing it off of three tags but I hope two is enough for the example)

I tried the following in my playbook



hosts: "[tag_Product=xxx, tag_Project=yyy]"



Regards

Mark

Giovanni Tirloni

unread,
Feb 3, 2015, 6:34:07 AM2/3/15
to ansible...@googlegroups.com
On Mon, 02 Feb 2015 13:57 -0800, Mark Olliver <pixi...@gmail.com>
wrote:
hosts: tag_Product_xxx:&tag_Project_yyy

http://docs.ansible.com/intro_dynamic_inventory.html#static-groups-of-dynamic-groups

Giovanni
Reply all
Reply to author
Forward
0 new messages