Need help with a static inventory of dynamic groups

41 views
Skip to first unread message

ppo...@greenlancer.com

unread,
Jun 23, 2016, 10:47:48 AM6/23/16
to Ansible Project
===================================================
Here is my static inventory of dynamic groups

[tag_ENV_prod] [tag_ROLES_bastion] [prod-bastion:children] tag_ROLES_bastion:&tag_ENV_prod [prod-servers:children] tag_ENV_prod:!tag_ROLES_bastion
=================================================== Calling the groups via an adhoc ansible command does NOT work. $ ansible 'prod-bastion' -i ec2.py --list-hosts [WARNING]: provided hosts list is empty, only localhost is available hosts (0): $ ansible 'prod-servers' -i ec2.py --list-hosts [WARNING]: provided hosts list is empty, only localhost is available hosts (0): =================================================== This however works

$ ansible 'tag_ROLES_bastion:&tag_ENV_prod' -i ec2.py --list-hosts hosts (1): 192.168.1.4 $ ansible '\!tag_ROLES_bastion:tag_ENV_prod' -i ec2.py --list-hosts hosts (8): 192.168.1.12 192.168.1.30

ppo...@greenlancer.com

unread,
Jun 23, 2016, 10:48:58 AM6/23/16
to Ansible Project
Why is it not possible to perform complex pattern matching in the inventory? How do other companies handle this?
Reply all
Reply to author
Forward
0 new messages