This is a small python script that generates an Ansible inventory from a Terraform state file. You can spin up a bunch of VMs using Terraform and then provision them with Ansible.
# run from the directory where your terraform.tfstate file is located
python tf-to-inventory.py
Look at the example hosts file to see the output of this script.
Inspired by the zookeeper-ansible-terraform recipe. I adopted much of the code and added support for Amazon EC2 instances.
MIT