Define group in hosts file based on intersection of 2 groups
395 views
Skip to first unread message
Iain M. Conochie
unread,
Sep 1, 2016, 11:54:18 AM9/1/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
Hello,
It is possible to limit the hosts the ansible command runs against by specifying patterns on the command line like so:
ansible webservers:!staging -m ping
Is it possible to use the same technique to define groups in the inventory file, so that the new group is defined by the intersection of 2 child groups?
Thanks
Iain
Brian Coca
unread,
Sep 20, 2016, 11:20:59 AM9/20/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
No, that is only available in the `hosts:` clause of a play, with --limit and for `ansible` in the host pattern specified (equivalent to `hosts:` in a play).
----------
Brian Coca
Raj
unread,
Aug 15, 2017, 11:43:50 AM8/15/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project, ia...@shihad.org
That should be possible.
I have been doing something like that using the escape character in command line. Ansible version 2.3