Setting up a server by hand works once. By the fifth server, or the third rebuild, small differences creep in and nobody is sure what was changed. Ansible describes the desired state of your servers in readable YAML and applies it over SSH, with no agent to install. This course teaches you to write playbooks and roles that are idempotent, reusable and safe to run again and again.

What you'll learn

  • How Ansible works: control node, managed nodes, SSH and modules
  • Static and dynamic inventories, groups and host variables
  • Ad hoc commands for quick checks and one-off changes
  • Writing playbooks with tasks, handlers, loops and conditionals
  • Idempotency: why it matters and how to keep tasks from making changes every run
  • Jinja2 templates for configuration files such as Nginx sites and environment files
  • Organising work into roles and using collections from Ansible Galaxy
  • Keeping secrets safe with Ansible Vault
  • Check mode, diff mode and testing roles with Molecule and ansible-lint
  • Rolling updates, tags, and running Ansible from CI

Who it's for

  • Developers and system administrators who manage more than a couple of servers
  • Teams that want repeatable server builds for staging and production
  • DevOps engineers combining provisioning tools with configuration management

Prerequisites

  • Comfortable on the Linux command line and with SSH keys (see Linux Command Line for Developers)
  • Basic YAML
  • Two or more Linux virtual machines or containers to practise on

Outcomes

By the end of this course you will be able to:

  1. Turn a manual server setup checklist into an idempotent Ansible playbook.
  2. Structure automation into reusable roles with sensible defaults.
  3. Store and use secrets without committing them in plain text.
  4. Test roles and roll out changes to a fleet with minimal disruption.

Course outline

ModuleTopic
1Configuration management and Ansible's model
2Installing Ansible and building an inventory
3Ad hoc commands and core modules
4Playbooks, handlers and idempotency
5Variables, facts and precedence
6Loops, conditionals and error handling
7Jinja2 templates
8Roles, collections and Galaxy
9Ansible Vault and secrets
10Testing with Molecule and ansible-lint
11Rolling updates and running Ansible from CI
12Project: provision a hardened web server from scratch

FAQ

How does Ansible compare with Terraform?

They solve different problems. Terraform creates cloud resources such as servers, networks and DNS; Ansible configures what runs on those servers. Many teams use both – see Terraform: Infrastructure as Code.

Do I still need Ansible if I use containers?

Less, but often still yes: for the hosts that run your containers, for databases and for servers that cannot be containerised.

Does it cover Ansible Automation Platform?

We focus on open-source Ansible on the command line. The skills carry over directly if your organisation later adopts a commercial platform.

How do I join?

Get in touch and we'll share the current format, schedule and enrolment details.