I wanted to share a demo that walks through how Red Hat Ansible Automation Platform can be integrated with HashiCorp Terraform to automate infrastructure across the full lifecycle ā from provisioning infrastructure to configuring services on top of it.
Many teams treat these tools as completely separate layers:
- Terraform provisions infrastructure
- Configuration tools install software later
- Operations teams handle everything after that
In practice, that often leads to gaps between provisioning and day-2 operations. This demo shows one way to connect those pieces together.
What the workflow looks like
The example workflow starts in Ansible Automation Platform and then hands off provisioning to Terraform:
- A job in Ansible Automation Platform triggers a Terraform Enterprise project.
- Terraform provisions infrastructure in Amazon Web Services.
- After provisioning completes, Ansible synchronizes the new infrastructure into its inventory.
- Ansible then runs configuration tasks to install and configure an NGINX web server.
- Finally, a simple insurance company website is deployed to demonstrate application configuration.
This approach lets Terraform focus on infrastructure provisioning, while Ansible handles configuration, orchestration, and lifecycle automation after the infrastructure exists.
Why this pattern can be useful
Some practical benefits of combining the tools this way:
- Clear separation of responsibilities
- Terraform handles infrastructure state
- Ansible handles configuration and operational automation
- Automated handoff between layers
- Newly created infrastructure automatically becomes available to Ansible workflows
- End-to-end automation
- Instead of stopping at provisioning, automation continues into configuration and service deployment
- Easier lifecycle management
- Build, configure, operate, and eventually retire infrastructure using coordinated workflows
Demo video
Hicham put together a walkthrough showing the full flow:
Curious how others are approaching this
Iām interested in hearing how others are combining Terraform and Ansible in real environments.
Some questions that come up often:
- Do you trigger Terraform from Ansible, or keep them as separate pipelines?
- How are you handling inventory synchronization after provisioning?
- Are you using Terraform Cloud / Enterprise, or running Terraform locally in CI?
- How do you structure Day-2 automation once infrastructure exists?
Would love to hear how others are structuring their workflows.