Inheriting static group_var data with dynamic inventory?

27 views
Skip to first unread message

Adam Kosmin

unread,
Jan 7, 2016, 2:33:04 PM1/7/16
to Ansible Project
Greets,

Assuming I've got the following defined in group_vars:foo.yml

---
bar: baz

Using dynamic inventory (ec2.py in my case), I'd love to do something like:

add_host: tag_group_foo
  groups: foo:children

The eventual goal is to be able to have my AWS instances benefit from data that is currently maintained in my static group_vars files so I don't have to re-invent that wheel. Seems like this should be possible but Ansible 2.1.x is giving me no love here. Thoughts?

Best,
Adam

Adam Kosmin

unread,
Jan 7, 2016, 2:34:08 PM1/7/16
to Ansible Project
Sorry, meant to say bar: baz is defined in group_vars/foo.yml

Josh Smift

unread,
Jan 7, 2016, 2:50:10 PM1/7/16
to ansible...@googlegroups.com
AQ (https://github.com/caredotcom/ansible-quartermaster) might be of interest.

-Josh (j...@care.com)






This email is intended for the person(s) to whom it is addressed and may contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized use, distribution, copying, or disclosure by any person other than the addressee(s) is strictly prohibited. If you have received this email in error, please notify the sender immediately by return email and delete the message and any attachments from your system.

Adam Kosmin

unread,
Jan 8, 2016, 2:13:12 PM1/8/16
to Ansible Project

Josh,

Thanks for the link but that's not going to be a good fit. I'm trying to use the add_host module to dynamically alter group memberships of tagged instances in AWS. It would be great if anyone could provide an example of how this might be done? I know the currently accepted approach is to manually maintain these group relationships in static inventory files as per http://docs.ansible.com/ansible/intro_dynamic_inventory.html#static-groups-of-dynamic-groups but that makes me depressed.

Best,
Adam
Reply all
Reply to author
Forward
0 new messages