LOOP · The DevOps Codex
Ch 11 · Configuration Management
Chapter 11 · Operate the Box

Configuration Management — when the host has to last

Configuration management (CM) is the discipline of describing, enforcing, and auditing the desired state of operating systems and applications on long-lived machines. The container revolution shrank its remit, but bare metal, network gear, Windows fleets, and air-gapped sites still keep the big four — Ansible, Chef, Puppet, Salt — very much alive. This chapter explains where CM still wins, what idempotency really means, and how to phase it out gracefully when the workload becomes immutable.

11.1 · What configuration management actually is

Definition. Configuration management is the practice of declaring the desired state of a running host — packages, files, services, users, kernel params — and using a tool to converge the actual state toward it, repeatedly and safely. It is distinct from infrastructure as code, which provisions the host itself (the VM, the disk, the network).

IaC (Ch 10)CM (this chapter)
Operates onCloud / hypervisor APIsOS inside the box
LifetimeResource lifecycle (create / update / destroy)Continuous (every 30 min)
Example"Create an EC2 m6i.large with 200 GB gp3.""Ensure nginx 1.25 is installed, running, with this config."
ToolsTerraform, Pulumi, Bicep, CFNAnsible, Chef, Puppet, Salt, DSC, Nix

11.2 · The big four — origins & status

Ansible (2012)

Michael DeHaan, acquired by Red Hat 2015. Agentless, YAML playbooks, push over SSH/WinRM. Now Ansible Automation Platform (AAP). Open-source core: ansible-core 2.18 (Nov 2024).

Chef (2009)

Adam Jacob's "Opscode". Ruby DSL recipes → cookbooks → runlists. Agent (chef-client) pulls from Chef Server. Acquired by Progress 2020. Open-sourced again as Chef Infra.

Puppet (2005)

Luke Kanies — the original. Ruby DSL, declarative. Agent pulls catalog every 30 min from Puppet Server. Acquired by Perforce 2022. Puppet Open Source → OpenVox fork in 2024.

SaltStack (2011)

Thomas Hatch. Python; ZeroMQ message bus for sub-second push. Acquired by VMware 2020, then Broadcom 2023. Now Salt Project.

ToolModelLanguageTransport2026 status
AnsiblePush (or pull via ansible-pull)YAMLSSH / WinRMStill the most-used CM tool; AAP for the enterprise.
Chef InfraPullRuby DSLHTTPSNiche; strong in regulated finance.
Puppet / OpenVoxPullPuppet DSL (Ruby-ish)HTTPSLong-tail enterprise; OpenVox in 2024.
SaltStackPush (event bus) or masterlessYAML + Jinja, PythonZeroMQStrong in telco / large fleets.

11.3 · Why CM faded

Two forces hollowed out the CM mainstream after 2014:

  1. Immutable infrastructure — Netflix popularised the phrase in 2013: instead of mutating a live host, bake a new image (AMI) and roll the fleet. Mutation surface = drift surface; rebuild is cheaper than reconcile.
  2. Containers + Kubernetes — the application brings its own filesystem; the host just runs containerd. The "interesting" config now lives in container images and K8s manifests, not in /etc.
Net effect
The DORA 2024 report shows CM-tool usage dropped from 65% (2018) to ~35% (2024) of respondents — almost all of the drop is workloads moving to containers.

11.4 · Where CM still wins in 2026

  • Bare-metal servers — racked HPC, hypervisors, storage filers. No container abstraction; you still configure the host.
  • Network gear — Cisco IOS, Juniper Junos, Arista EOS. ansible-network collections speak NETCONF/SSH; Nornir for Python shops.
  • Windows fleets — domain joins, DSC (Desired State Configuration), GPO orchestration. Ansible + WinRM or PowerShell DSC.
  • Regulated / air-gapped — defence, classified, OT plants. Pull-based agents over an internal mirror; signed catalogs.
  • Hybrid cloud — when one playbook has to configure RHEL on prem, EC2, and an Azure VM identically.
  • IoT / edge fleets — Raspberry Pi farms, kiosks, retail POS, vehicles. AWS IoT Greengrass + Ansible-pull on boot.

11.5 · Ansible — the canonical CM tool today

ConceptWhat it is
InventoryList of hosts (INI / YAML / dynamic plugin from EC2, Azure, GCP, Kubernetes).
PlaybookYAML file mapping hosts → ordered list of tasks.
ModuleIdempotent unit of work (apt, copy, systemd, kubernetes.core.k8s).
RoleReusable bundle: tasks/, handlers/, templates/, defaults/, meta/.
CollectionDistribution unit since v2.10 — roles + modules + plugins, versioned, published.
GalaxyPublic registry of roles + collections (galaxy.ansible.com).
AWX / AAPWeb UI, RBAC, scheduling, job templates, surveys. AAP is the supported Red Hat product.
ansible-lintStyle + correctness linter; CI-friendly.
MoleculeRole testing framework — spins Docker/Podman/EC2, applies role, verifies.
# site.yml — minimal hardening playbook
- hosts: webservers
  become: true
  roles:
    - common
    - { role: nginx, nginx_version: '1.27' }
    - { role: ufw, ufw_allowed_tcp: [22, 80, 443] }
  tasks:
    - name: Ensure unattended-upgrades is on
      ansible.builtin.apt:
        name: unattended-upgrades
        state: present

11.6 · Agentless vs agent — the eternal trade-off

Agentless (Ansible)Agent (Puppet, Chef, Salt minion)
How runs startPush from a control node over SSH/WinRM.Daemon on each host polls or listens.
BootstrappingSSH key + Python — trivial.Install package + register cert — extra step.
Scale ceilingThousands per controller; uses mitogen / async / forks.Tens of thousands per master (Salt: 100k+ minions documented).
Convergence cadenceWhen you run it.Continuous — e.g. Puppet every 30 min by default.
Network directionOutbound from controller.Outbound from each host (firewall-friendly).
Failure blast radiusOne bad task = wide push fan-out.Self-healing if master is briefly down.

11.7 · Idempotency — the central concept

Definition. An operation is idempotent if running it once or running it ten times produces the same end state. CM modules must be idempotent: state: present should be a no-op when the package is already installed.

Why it matters
Continuous convergence assumes the run can be re-executed safely. A non-idempotent task (e.g. shell: echo line >> /etc/hosts) silently corrupts state every 30 minutes. Prefer lineinfile / blockinfile / typed modules over raw shell / command.

11.8 · Drift detection & compliance

  • Puppet — agent runs every 30 minutes by default; reports back to PuppetDB; dashboards flag "out of sync".
  • Ansible — --check mode (dry-run) + --diff; can be cron'd as a compliance scanner.
  • Salt — state.highstate test=true; salt-run jobs.list_jobs for audit.
  • OpenSCAP — NIST-driven configuration scanner; STIG, CIS, PCI profiles.
  • InSpec (Chef) — Ruby DSL for compliance tests; describe package('openssl') do its('version') { should cmp >= '3.0' } end.
  • Goss / dgoss / Serverspec — lightweight server-state assertions, often run inside Molecule.

11.9 · Bootstrapping & cloud-init

The modern pattern layers three tools so each does what it's best at:

Packer
→
golden image (AMI/qcow2)
→
cloud-init (first boot)
→
Ansible last-mile
  • Packer (HashiCorp, BSL since 2023) — bake base image with kernel hardening, agents pre-installed.
  • cloud-init — the de-facto multi-cloud first-boot agent (Ubuntu/Debian/RHEL/Amazon Linux). Handles networking, SSH keys, hostname.
  • Ansible (or Chef/Salt) — the variable, environment-specific bits (app config, secrets, certificates).

11.10 · The modern alternative — Nix / NixOS

Definition. Nix (Eelco Dolstra, 2003 PhD thesis; v2.18 LTS in 2024) is a purely functional package manager. NixOS applies the same idea to the whole OS: the entire system is built from a deterministic expression in configuration.nix; switching configs is atomic and rollback-able.

PropertyTraditional CMNixOS
State modelConvergent (drives existing state toward target)Constructive (builds the target from scratch)
Rollback"Run a previous playbook" — fragileReboot into a previous generation — atomic
ReproducibilityBest-effortBit-for-bit reproducible builds
AdoptionMainstreamNiche but growing (Determinate Systems, Replit, Anduril)

11.11 · Replacement strategy — phasing CM out gracefully

  1. Inventory the playbooks. Tag each by why it still exists: host config, app deploy, network gear, compliance.
  2. App-deploy plays — migrate first; replace with a container image + K8s/Nomad manifest.
  3. Host-config plays — fold into Packer-baked AMIs + cloud-init for the volatile bits.
  4. Compliance plays — keep as scheduled --check runs; treat output as audit telemetry, not enforcement.
  5. Network gear & air-gapped sites — keep CM indefinitely; there is no container alternative.
Heuristic
If a host is rebuilt more than once per week, you don't need a CM tool — you need a better image pipeline. If it lives for a year, CM still earns its keep.
long-lived host (mutate in place) CM (Ansible / Puppet / Salt / Chef) ephemeral host (rebuild instead) Packer + cloud-init + containers migrate when rebuild > mutate

11.12 · Self-check

Q1 · Which property must every CM task have to be safe under continuous convergence?
Polymorphism
Idempotency
Determinism of output formatting
Transactional rollback
Q2 · You manage 2,000 Cisco routers across 30 sites. Best fit?
Helm chart per router
Ansible network collections over SSH/NETCONF
Terraform AWS provider
Docker Compose
Q3 · What is the principal reason CM-tool usage has shrunk since 2014?
Tooling got too expensive
Cloud providers banned it
Immutable infrastructure + containers replaced the long-lived mutable host
YAML became unfashionable