Infrastructure as Code with AI: Terraform and Ansible
For infrastructure and platform engineers who want AI to speed up Terraform and Ansible work without letting an unreviewed plan or playbook reach production.
The curriculum is being prepared and reviewed. Enrollment is not open yet.
About this course
Infrastructure code is a strong fit for AI assistance because it is declarative, repetitive and well documented. It is also a risky one: a plausible-looking resource argument from an old provider version, a destroy hidden in a long plan, or a playbook that is not idempotent can cause outages that ordinary application bugs do not.
This course teaches a verify-everything workflow. For Terraform and OpenTofu you generate and refactor modules with an assistant grounded in current provider documentation (including through HashiCorp's Terraform MCP server), import existing resources, write terraform test suites, and use the model to explain plans rather than approve them. For Ansible you generate roles and playbooks, use Red Hat Ansible Lightspeed and the Ansible development tools, and prove idempotency with ansible-lint and Molecule. You then wire policy as code (Sentinel, OPA/Conftest, Checkov, Trivy) into CI so that every AI-assisted change faces the same gates, and finish with an operating model for agents that touch state, credentials and drift. Product capabilities are stated as of October 2026.
What you will be able to do
Explain why IaC is prone to specific AI failure modes (stale provider schemas, invented arguments, non-idempotent tasks, hidden destroys) and how each is caught
Generate and refactor Terraform or OpenTofu modules grounded in current provider documentation, and validate them with fmt, validate, tflint and terraform test
Use an assistant to summarize and risk-rank a Terraform plan while keeping apply behind a human approval
Generate Ansible roles and playbooks and prove idempotency and correctness with ansible-lint and Molecule
Enforce policy as code on AI-assisted changes using Sentinel or OPA/Conftest plus Checkov or Trivy in CI
Configure an MCP-connected agent for infrastructure work with read-only defaults, scoped credentials and an audit trail
Syllabus
5 modules · 16 lessons · about 12 hours
1
Module 1: Where AI Helps and Hurts in Infrastructure Code
The failure modes specific to IaC and the verification loop that answers them.3 lessons
Hallucinated Arguments, Stale Providers and Hidden Destroys
The Verify Loop: Generate, Format, Validate, Plan, Test, Review
Grounding Assistants in Current Provider and Module Documentation
2
Module 2: Terraform and OpenTofu with AI
Writing, importing, testing and reviewing Terraform with an assistant in the loop.4 lessons
Generating and Refactoring Modules: Variables, Outputs and Moved Blocks
Importing Existing Infrastructure and Generating Configuration
Writing terraform test Suites with an Assistant
Plan Review: Using a Model to Explain and Risk-Rank Changes
3
Module 3: Ansible with AI
Playbooks and roles that are generated fast and proven idempotent.3 lessons
Generating Roles and Playbooks with Ansible Lightspeed and General Assistants
Idempotency and Correctness: ansible-lint and Molecule as Gates
Converting Shell Runbooks into Ansible
4
Module 4: Policy as Code and CI Gates
The same checks for every change, whoever or whatever wrote it.3 lessons
Sentinel and OPA/Conftest Policies for Plans
Static Scanning with Checkov and Trivy
A Pull Request Pipeline for AI-Assisted Infrastructure Changes
5
Module 5: Agents, MCP and the Operating Model
Letting agents read and propose without letting them silently change production.3 lessons
The Terraform MCP Server and Ansible Development Tools MCP Server: What Agents Can See and Do
Credentials, State Files and Secrets: Keeping Agents Read-Only by Default
Drift, Incidents and Accountability for AI-Assisted Changes
Exam and certificate
The exam unlocks once you have completed every lesson. It draws 20 questions from a larger bank, spread across the modules, with the answer options shuffled for each attempt. You have 40 minutes and need 80% to pass. After a failed attempt you can try again after 24 hours, up to 3 attempts in total. Feedback is given per module, never as the answer key.
Passing earns a certificate of completion and assessment from the Wirewalk Institute of AI with a unique ID that anyone can check at institute.wirewalk.com/verify. It is not an accredited qualification or a vendor certification. How certification works.
The Wirewalk Institute of AI is independent. This course teaches publicly documented products and is not affiliated with or endorsed by HashiCorp (Terraform, HCP Terraform, Terraform MCP server, Sentinel), OpenTofu, Red Hat (Ansible, Ansible Automation Platform, Ansible Lightspeed, Ansible development tools MCP server), Open Policy Agent, Checkov, or Aqua Security (Trivy). Product and company names are trademarks of their respective owners.
A free, one-hour, hands-on start built on one realistic job: sorting a property manager's 1,150 monthly maintenance requests. You get an API key the safe way, make real calls with curl and an official Python SDK, run them over forty work orders, read stop reasons, usage and errors, estimate the monthly cost, and decide whether the script is ready. Exercises run on your own provider account for well under a dollar.
A code-first course on integrating LLMs into Python the way production code needs it: uv projects and secrets, the OpenAI, Anthropic and Google GenAI SDKs side by side, async concurrency and streaming, Pydantic structured outputs and tools, retries, local models, embeddings and RAG, FastAPI and pandas integration, testing and evals with pytest, observability, cost tracking and deployment.
Call OpenAI, Anthropic, Gemini and local Ollama models from Perl with real CPAN modules, add streaming, concurrency and validated JSON output to text pipelines, and use AI coding assistants to modernize legacy Perl behind characterization tests.