Configuration management is describing what a machine should look like, in files, and letting a tool make it so. Instead of logging in and typing commands, you declare packages, files, users and services, apply the description, and get the same result on one server or a thousand.
Key concepts
- Declarative state: you state the end result, such as "this package is installed", and the tool works out the steps.
- Idempotence: applying the same description twice changes nothing the second time.
- Drift: machines slowly diverge from their description through manual edits; the tool detects and corrects it.
- Inventory and variables: which machines exist, how they are grouped and what differs between them.
- Version control and review: configuration is code, so it is committed, reviewed and tested.
Vocabulary
- Playbook, manifest, recipe: the file that holds the desired state, named differently by each tool.
- Agent and agentless: a tool that runs a daemon on each machine, or one that connects over SSH when needed.
- Immutable infrastructure: replacing machines with fresh images instead of changing them in place.
- Secret: a password or key that must be stored encrypted, never in plain text.
What to study, in order
- Configure one server by hand and write every command in a text file.
- Install one configuration management tool and reproduce that file as a declarative description.
- Apply it twice and confirm the second run changes nothing.
- Add variables and templates so two machines share a role but differ in details.
- Edit a file by hand on the server, run the tool again and watch the drift disappear.
- Keep the secrets encrypted and test the description on a throwaway virtual machine.