The answer to ansible vs terraform depends on which part of your job touches the cloud. Terraform builds the resources: networks, virtual machines, databases, buckets, and the addresses that point to your services. Ansible sets up what runs inside them: packages, files, users, services, and network gear.
Teams use both, and the order matters: Terraform first, then Ansible. Below you will find each path's cost, the version to install, and how to pick one. One exam has a flat published price, and the other has no published price but a free retake. Support windows differ too, from a version leaving support this November to one that runs into late 2027.
Ansible vs Terraform: what does each tool actually own?
The split is clean. Terraform owns creation: networks, virtual machines, databases, buckets and the addresses that point to your services. Ansible owns configuration: packages, files, users, services, and the network gear that already runs.
Terraform keeps a state file that records every resource it created. That record lets it show a diff before it changes anything, and it spots drift. Ansible keeps no state file. It runs tasks, then checks that each one worked.
| Job on the infrastructure | Ansible | Terraform |
|---|---|---|
| Create a network, virtual machine, database or bucket | No. It can call cloud APIs but keeps no state | Yes. Declarative HCL, state, and a plan first |
| Configure an operating system: packages, files, users, services | Yes. Idempotent playbooks, agentless over SSH | Awkward. Needs cloud-init or a provisioner |
| Push config to switches, routers and network gear | Yes. Network collections with diff output | No. Not its domain |
| Preview a change, or spot drift, before you touch a cloud account | No. It runs tasks, it shows no diff | Yes. Plan output, plus GA Policy checks in 1.17 |
| Hand a finished server to the config layer | Needs an inventory source | Needs an output or a tag to read |
Ansible needs an inventory, a list of hosts it can reach. Terraform needs an output or a tag for the next tool to read. That handoff is why the vendors now ship an official bridge.
How much does each certification path cost in 2026?
Cost is where the two paths differ most. The HashiCorp Terraform Associate page lists the exam at $70.50 plus taxes and fees. It runs for one hour with multiple choice questions and stays valid for two years.
That is $35.25 per credential-year. A free retake is not included, so a failed attempt costs another $70.50. Red Hat sells its Ansible exams through its exam store and resellers, with no list price.
Its Red Hat individual exams page says an unsuccessful first attempt earns a free retake. Results come within five business days. The EX294 exam is a practical lab with no internet access. Red Hat reports that score within three US business days.
| Cost or rule | Terraform path: HashiCorp Associate 004 | Ansible path: Red Hat EX294 |
|---|---|---|
| Published exam price | $70.50 USD plus taxes and fees | No public list price. Sold through Red Hat's exam store |
| Cost per credential-year | $35.25 over a 2-year validity | Not computable. No published exam price |
| Cost of a failed attempt | $70.50 again, no free retake | $0. A first failed attempt earns a free retake |
| Exam format | Multiple choice, 1 hour, English, aligned to Terraform 1.12 | Practical exam, no internet, judged on new systems |
| Result turnaround | Not stated on the exam page | 3 US business days for EX294, 5 for other exams |
| Credential validity | 2 years | Not stated on the pages checked |
| Stated prerequisites | Basic terminal skills, plus cloud and on-premises architecture | Red Hat courses RH124 and RH134 or RH199, plus AU294 |
| Practice platform cost | HCP Terraform Free: 500 resources, unlimited users, $0 | Ansible Automation Platform is quote-only, priced by sizing |
Lab cost is the next line, and it has a cliff in it. The HashiCorp pricing page lists HCP Terraform tiers per managed resource per month. Essentials starts at $0.10, Standard at $0.47, and Premium at $0.99.
The Free tier covers 500 managed resources with unlimited users at no charge. The older Free plan ended on March 31, 2026. The HashiCorp Terraform Cloud pricing guide breaks down each tier.
The free tier stops at 500 resources. At the listed Essentials rate, 501 resources would cost $50.10 a month, or $601.20 a year. A lab of 1,000 resources would cost $1,200 a year on Essentials and $11,880 a year on Premium. These totals come from HashiCorp's listed prices.
The Ansible side publishes no per-host fee. Red Hat says Ansible Automation Platform pricing varies by sizing and subscription.
Which version would you actually be learning on?
Version choice matters more than most comparison pages admit. The Ansible release and maintenance schedule shows the release cadence. Ansible ships a major version every six months or so, usually in May and November. Support spans three majors at a time.
| Product | Version | Released | Support window |
|---|---|---|---|
| Terraform | 1.17.1 | 2026-10-28 | Current latest. The 1.16.7 patch line runs in parallel |
| Terraform | 1.17.0 | 2026-10-21 | Terraform Policy generally available, -minimal-refresh planning |
| ansible-core | 2.21 | GA May 2026 | Security-only from May 2027. End of life Nov 2027 |
| ansible-core | 2.20 | 2025-11-03 | Critical fixes ended 2026-05-18. Security-only to 2026-11-02. EOL May 2027 |
| ansible-core | 2.19 | 2025-07-21 | Critical fixes ended 2025-11-03. Security-only to 2026-05-18. EOL Nov 2026 |
| Ansible Community Package | 14.x | Current | Only maintained major. Minors every 4 weeks. 13.x EOL Jun 2026 |
The cliff sits in 2.19. It reached general availability on July 21, 2025 and reaches end of life in November 2026. A tutorial pinned to that version teaches a release that loses support within weeks. Learn 2.21, which stays supported until November 2027.
Terraform is on version 1.17.1, released October 28, 2026. Any current tutorial should match a 1.x release from this year.
Do you need both tools, or has the vendor line already dissolved?
Since June 2026, HashiCorp and Red Hat ship an official bridge. The old ansible vs terraform framing treated the tools as rivals.
Their announcements cover an official Ansible Automation Platform provider for Terraform. Teams can manage platform resources through code. They also cover the Terraform Ansible collection 2.0, now generally available on pyTFE 1.0. Ansible users can manage Terraform projects, workspaces and runs from the platform.
The collection includes an experimental dynamic inventory plugin. It reads Terraform state from HCP Terraform and builds Ansible inventory from it. You need no Terraform command line tool and no backend credentials.
HashiCorp moved Terraform from the Mozilla Public License to the Business Source License on August 10, 2023. The OpenTofu Manifesto records the change, and the community fork is now a Linux Foundation project.
How do you pick ansible vs terraform for a job posting?
The choice comes down to the verbs in the posting. Creating a network, a virtual machine, a database or a bucket points to Terraform. Configuring an operating system, patching hosts or pushing a release points to Ansible. A posting that names both is a pipeline, not a contradiction.
| If this is true of you | Pick | The number that decides it |
|---|---|---|
| You want the cheapest recognized credential this quarter | Terraform | $70.50 flat, no exam bundle |
| You want a credential with a retake built in | Ansible | First fail earns a free retake, so it costs $0 |
| You are targeting cloud-native DevOps roles | Terraform | Free tier covers 500 resources for a real lab |
| You are targeting sysadmin, platform or network automation roles | Ansible | EX294 tests practical work on a live system |
| You are learning from a tutorial written before 2026 | Check the version first | 2.19 reaches EOL Nov 2026. Learn 2.21 |
| You need a diff before you touch production cloud | Terraform | Plan output, plus GA Policy checks in 1.17 |
| Your employer will not touch Business Source License code | Ansible or OpenTofu | Terraform moved from MPL to BUSL on 2023-08-10 |
| A job posting mentions both tools | Both, in this order | Terraform provisions, then collection 2.0 hands off to Ansible |
What should you do in the next 90 days?
Whichever you pick, start with one exam. If you want the cheapest recognized credential this quarter, take the Terraform Associate exam. Its prerequisites are terminal skills and an understanding of cloud architecture. The $70.50 fee is the whole cost unless you fail.
The Terraform Associate certification cost page shows the full fee breakdown. If you want a retake built in, take the Red Hat path. A first failed attempt earns a free retake there, so one failure adds no second exam fee.
Practice before you pay. The HCP Terraform Free tier gives you 500 managed resources free. Install Ansible 2.21, not 2.19, so your lab runs a supported version.
The best DevOps certifications list shows where each exam sits in a career path. The what a DevOps engineer is guide covers the daily work behind those titles.
Photo: Elchinator, Pixabay Content License, via Pixabay (https://pixabay.com/photos/source-code-software-computer-4280758/)
Fazlur Rahman





