Ansible Inventory - Groups by Regular Expression?

759 views
Skip to first unread message

Tomb

unread,
Feb 22, 2016, 11:02:23 PM2/22/16
to Ansible Project
Is it possible to use regular expressions to create groups within an inventory file? Such as the below:
hosts
SRX110-1-GB
SRX110-2-GB
SRX110-5-GB
SRX550-1-GB
SRX110-1-US
SRX240-1-US
SRX240-2-GB

[MODEL-SRX110]
~^SRX110.*

[MODEL-SRX240]
~^SRX240.*

[MODEL-SRX550]
~^SRX550.*

[COUNTRY-GB]
~.*-GB$
[COUNTRY-US]
~.*-US$


Brian Coca

unread,
Feb 23, 2016, 3:13:12 PM2/23/16
to ansible...@googlegroups.com
no, but the patterns do work in host expressions (hosts: ~.*-GB$ , --limit '~*-US$')


----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages