Skip to the note
zecrazytux.net sysadmin  |  note index

~ / sysadmin / ansible talk

sysadmin

Introducing Ansible at a free software day

Sysadmin Ansible Talk

A short talk given to a local free software audience. The aim was not to sell a product but to show that configuration management can start with a plain text file and a list of machines.

The problem being solved

Running more than a couple of servers by hand invites drift. Two machines that were identical last month quietly stop being identical. A way to describe the intended state, apply it and keep a record of the changes is the whole point of configuration management.

Why a new tool was interesting

  • No agent to install on every machine. Access is over SSH with an ordinary account.
  • Inventory and playbooks are written in YAML, which is easy to read and diff.
  • The model is push: a run reports immediately whether each step succeeded.
  • Small modules are easy to write in whatever language is convenient.

The outline of the talk

  1. Inventory: a file listing hosts and groups, with per host and per group variables.
  2. Facts: the tool gathers basic information about each host before a run.
  3. Ad hoc commands: one module applied to a group of hosts for quick checks.
  4. Modules: small units of work such as installing a package or editing a line in a file.
  5. Playbooks: ordered lists of tasks, with handlers that run only when something changes.

A realistic example

A small playbook installs a baseline set of packages, deploys authorised keys, and configures a monitoring agent. The same tasks are reused between roles, and a change to the baseline applies to every machine in the group. The deck that accompanied the talk is kept in the notebook.

Slides: introducing Ansible. Reference: the Ansible documentation.