There are plenty of articles out there discussing the roles Ansible and Terraform could/should play in the world of infrastructure automation. My goal is to outline a proven workflow for using them together, a commonly agreed upon pattern, to provision and configure resources in the cloud. I will use Ansible to orchestrate Terraform, let Terraform handle the provisioning and state management of cloud resources, and finally let Ansible configure the deployed resources.
Autodotes Blog Post:
https://autodotes.com/posts/iZ7iGytavC1u1eUE4txb
Source Code:
https://github.com/zjleblanc/ansible-terraform/tree/master/create_web_demo
00:00 - Intro
01:36 - Terraform Provision Basic Infrastructure
06:56 - Using a Remote Backend
13:10 - Terraform Provision Web Server Infrastructure
16:45 - Ansible Playbook
22:36 - Ansible Automation Platform Workflow