Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to combine static and dynamic inventories (or multiple inventories) with terraform-inventory? #107

Open
queglay opened this issue Feb 23, 2019 · 2 comments

Comments

@queglay
Copy link

queglay commented Feb 23, 2019

Are there suggested best practices for combining multiple inventories with this tool?

I was reading this blog post about how to combine multiple inventories with similar tools to terraform-inventory.
It suggests to point your inventory to a folder, and multiple inventory files will be combined.
I'm not sure if its possible to do it here though, because terraform-inventory is an executable.

http://allandenot.com/devops/2015/01/16/ansible-with-multiple-inventory-files.html

@DMarby
Copy link
Contributor

DMarby commented Aug 24, 2019

You can accomplish this by creating a script in the inventory folder that invokes terraform-inventory.

Here's an example that uses both terraform-inventory and a static inventory:
https://github.com/DMarby/infrastructure/blob/master/ansible.cfg#L7
https://github.com/DMarby/infrastructure/tree/eb44681595a093a11b4d879e202ce08a496d06fb/ansible/inventory

@queglay
Copy link
Author

queglay commented Aug 24, 2019

Thanks, that's cool you can point it at a specific tfstate file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants