Create multiple dynamic inventories or custom dynamic inventory?

177 views
Skip to first unread message

chall...@gmail.com

unread,
Dec 22, 2016, 10:34:33 AM12/22/16
to Ansible Project
Hi,
     We have multiple aws accounts and want to use ansible as a configuration management system for them, so how do we proceed, to manage multiple aws accounts with one ansible server.
1) we have an account that is peered to all other accounts, so i want to install ansible there.
2) but how do i proceed with inventory, how to differentiate between different aws accounts, because ec2.py would act as dynamic inventory for one account , how to have different envionments, and how to run playbooks on different accounts and vpcs, should we create a custom inventory?

Simon Wydooghe

unread,
Dec 22, 2016, 12:06:28 PM12/22/16
to Ansible Project
Hey,

No idea what the best practice would be, but you could customize the ec2.py script and change the following line: https://github.com/ansible/ansible/blob/devel/contrib/inventory/ec2.py#L223
You could hardcode it or make it dynamic.

So you could have ec2_account1.py with ec2_account1.ini, ec2_account2.py with ec2_account2.ini, etc.

Regards,
Simon

Josh Smift

unread,
Dec 22, 2016, 1:18:05 PM12/22/16
to ansible...@googlegroups.com
https://github.com/caredotcom/ansible-quartermaster might help you get
what you need here.

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

(apologies for the automatic corporate disclaimer that follows)

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.
Reply all
Reply to author
Forward
0 new messages