thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Commonly confused · DevOps & Automation

Ansible vs Terraform: What's the Difference?

Terraform is an infrastructure provisioning tool that declaratively creates and manages cloud and infrastructure resources while tracking them in a state file. Ansible is primarily a configuration management and automation tool that connects to existing systems over SSH or APIs to configure them using procedural playbooks.

vs
AnsibleTerraform
Primary purposeConfiguration management and task automationInfrastructure provisioning (IaC)
LanguageYAML playbooksHashiCorp Configuration Language (HCL)
StyleProcedural tasks with declarative modulesDeclarative
State trackingNo state file; checks live systemsState file maps config to real resources
AgentAgentless (SSH, WinRM, APIs)Agentless (provider APIs)
Typical useInstall packages, push configs, network device changesCreate VPCs, VMs, load balancers, DNS records
Key commandsansible-playbookterraform init, plan, apply, destroy
Remember it

Terraform builds the house; Ansible furnishes it.

Exam tip

Expect questions on Terraform's state file and plan/apply workflow, and on Ansible being agentless and push-based. Many real pipelines use both together.

Tested on

More DevOps & Automation look-alikes