Terraform
Things I had to learn the hard way, should have called it "Terror Form"
Generating Ansible Inventory
This is the easiest way I've found; There are dynamic ansible inventories, but the code is vast and often unmaintained. I'm keeping it simple.
Start off with a file called templates/ansible/inventory.tmpl
Tweak this to your own requirements.
Then in your Terraform module, you can use the following to generate the template file to a local variable.
Followed by a local file resource to output it to the Terraform machine.
Types
Some things when using the Terraform types.
Strictly typed, so
"127.0.0.1"
is not equal to127.0.0.1
Use type conversion functions.
Last updated