Ansible vs Terraform
- tags
- Open Source
Ansible vs Terraform #


Both Terraform and Ansible are capable of executing remote commands on the Virtual Machine that is newly created.
- This means, both the tools are agentless. There is no need to deploy agents on the machines for operational purposes.
Terraform uses cloud provider APIs to create infrastructure and basic configuration tasks are achieved using SSH . The same goes with Ansible – it uses SSH to perform all the required configuration tasks.
- The “state” information for both does not require a separate set of infrastructure to manage, thus both the tools are masterless.
Configuration Management vs IaC #
IaC asks what resources are there and CM asks how are they configured
OCR of Images #
2023-10-16_12-19-51_screenshot.png #

Ansible Versus Terraform Ansible Terraform Is a Configuration Management tool Isan orchestration and lac tool Supports mutable infrastructure Supports immutable infrastructure Works via SSH Works via API calls Follows procedural language Follows declarative language Open source Open source
2023-10-16_12-21-04_screenshot.png #

Terraform Ansible Type Orchestration tool Configuration management tool Syntex HCL YAML Language Declarative Procedural Default approach Mutable infrastructure Immutable infrastructure Lifecycle management Does support Doesn't support Capabilities Provisioning and configuring Provisioning and configuring Agentless Masterless
2023-10-16_12-17-03_screenshot.png #

Automation: Configuration Management and Infrastructure as Code Configuration Management (CM) Ensures application implementation, function, and performance Is key to DevOps because it can be automated with code to accomplish common tasks instead of relying on manual CM E </> intervention Uses the CM tool Ansible to integrate with the OCI DevOps service Infrastructure as Code (laC) lac Automation Defines, configures, and provisions infrastructure using readable code, eliminating the need for manual system setup Is a key DevOps practice that allows for infrastructure automation, which works together with the continuous delivery model Uses the lac tool Terraform to integrate with the OCI DevOps service