Introducing Ansible at a free software day
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
- Inventory: a file listing hosts and groups, with per host and per group variables.
- Facts: the tool gathers basic information about each host before a run.
- Ad hoc commands: one module applied to a group of hosts for quick checks.
- Modules: small units of work such as installing a package or editing a line in a file.
- 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.