recommended tool to create ansible dynamic inventory from terraform state files?

466 views
Skip to first unread message

Pablo Escobar

unread,
Apr 12, 2018, 9:26:38 AM4/12/18
to Terraform
Hi,

I would like to use Terraform together with Ansible and I would like to create ansible inventories from the terraform state files. In a quick google search I have found few different tools to do this.

Before I start testing all them can anyone recommend a tool to generate ansible dynamic inventories from terraform state file? I would like:

* Something that you are using in production ;)
* support for latest versions of Ansible and Terraform
* Actively maintained
* OpenStack support
* nice documentation would be a plus

Any suggestion?

Thanks in advance.
Pablo.

p.s. these are some of the bookmarks I saved

ja...@fpcomplete.com

unread,
Apr 13, 2018, 1:31:54 AM4/13/18
to Terraform


On Thursday, April 12, 2018 at 9:26:38 AM UTC-4, Pablo Escobar wrote:
Hi,

I would like to use Terraform together with Ansible and I would like to create ansible inventories from the terraform state files. In a quick google search I have found few different tools to do this.

Before I start testing all them can anyone recommend a tool to generate ansible dynamic inventories from terraform state file? I would like:

* Something that you are using in production ;)
* support for latest versions of Ansible and Terraform
* Actively maintained
* OpenStack support
* nice documentation would be a plus


This one does not meet all of those desired requirements, but it's still a good example to review. We are using tags on EC2 instances and using an inventory script to look them up and render the inventory file https://github.com/fpco/kubespray/blob/master/contrib/aws_inventory/kubespray-aws-inventory.py. There is also https://github.com/fpco/kubespray/blob/master/contrib/aws_inventory/kubespray-aws-inventory.py as another example.

Whether you can use a generic tool, or need to write and maintain your own will depend on the nuances of your infrastructure and constraints/requirements/concessions.

Goodluck!
Reply all
Reply to author
Forward
0 new messages