Skip to content

Ansible

Configuration management tool for automating provisioning and maintaining desired state across multiple hosts from a single control node.

A reference section

These pages are a learning reference for Ansible; host names and IPs are examples. For the GitOps approach to deploying stacks, see GitOps.

Start with the Complete Tutorial for the concepts and an end-to-end walkthrough, or Base Configuration for the complete worked example.

  • Ansible Install & project setup


    Installing Ansible, initial SSH key setup, and the project structure.

  • Installation


    Installing Ansible on the control node.

  • Writing Tasks


    How tasks work — modules, loops, conditionals, register, handlers, and blocks.

  • Common Modules


    The toolbox — apt, copy, template, file, service, and the rest, with examples.

  • Templates & Jinja2


    Writing .j2 files — Jinja2 variables, filters, loops, and conditionals.

  • Facts & Variables


    System facts, magic variables, and which value wins when names collide.

  • Collections & Galaxy


    Where modules come from, FQCNs, and installing collections.

  • Ad-hoc commands & running playbooks


    One-off commands, running playbooks, check mode, --diff, tags, and limiting scope.

  • Inventory


    Defining managed hosts and running ad hoc commands.

  • Variables


    Variables let you define values once and reuse them.

  • Vault


    Encrypting secrets and sensitive variables in playbooks and inventory.

  • Roles


    Structuring playbooks into reusable, portable units.

  • Playbooks


    Repeatable, ordered task definitions for configuring hosts.

  • Docker Compose Templates


    Templates for running Docker containers with Ansible.