August 2019
Beginner
608 pages
16h 7m
English
When Terraform generates the infrastructure, it keeps a local cache of the objects it has built. All information needed to generate a dynamic inventory is available from this file, but we need a plugin or provider to parse and transform the data so Ansible can understand it. We use the following Ansible provider to do that: https://github.com/nbering/terraform-inventory.
It's easy to install. You need to download the terraform.py file, place it in your patch, and mark it as executable, as shown in the following example:
$cd /usr/local/bin && sudo wget https://raw.githubusercontent.com/nbering/terraform-inventory/master/terraform.py && sudo chmod 755 terraform.pyRead now
Unlock full access