Selecting Host in Multiple Groups

33 views
Skip to first unread message

James Goodhouse

unread,
Mar 10, 2014, 3:28:24 PM3/10/14
to ansible...@googlegroups.com
Hey All,

How would one go about targeting hosts based on being them being in multiple groups? For example, I have a staging inventory file with a Vagrant group and a Japan group. I want to target a vagrant server that is also in the Japan group, but don't want the Japan hosts that aren't in the Vagrant group.

I hope that was clear :-/

Thanks in advance!

- James

Serge van Ginderachter

unread,
Mar 10, 2014, 3:38:09 PM3/10/14
to ansible...@googlegroups.com

On 10 March 2014 20:28, James Goodhouse <jamg...@gmail.com> wrote:
How would one go about targeting hosts based on being them being in multiple groups? For example, I have a staging inventory file with a Vagrant group and a Japan group. I want to target a vagrant server that is also in the Japan group, but don't want the Japan hosts that aren't in the Vagrant group.

​Sounds like "Vagrant:&Japan" ?​

James Goodhouse

unread,
Mar 10, 2014, 4:04:16 PM3/10/14
to ansible...@googlegroups.com
That would be a group in the inventory file, correct? Is there a way to do it via the -l flag?
Reply all
Reply to author
Forward
0 new messages