In the previous sections, we looked at how to provision a vanilla instance using Terraform. We then learnt how to provision a vanilla EC2 instance and execute post builds using the Terraform
remote-exec provisioner. Now, we'll look at how Terraform can be integrated with Ansible to perform configuration management tasks. We will consider two different scenarios. In scenario one, we will provision an EC2 instance and run Ansible using push mode, which is the primary way that we can use Ansible to perform automation. In scenario two, we will provision an EC2 instance and run Ansible in pull mode using the
ansible pull approach.
$ mkdir thirdproject $ cd thirdproject
In this example, we will use the recommended practices to create Terraform templates. We will remove our AWS
access_key and our AWS
secret_key from our...