# Configuration management

> Describing how servers should be set up, and letting a tool keep them that way.

- Level: Intermediate
- Topics: Cloud, Software
- URL: https://tidbit.legios.com.ar/configuration-management/
- In Spanish: [Gestión de la configuración](https://tidbit.legios.com.ar/es/configuration-management/)

A company might have hundreds of servers that all need the same users, packages, settings and security patches. Doing that by hand, logging into each one, is slow and error-prone: sooner or later two servers that should be identical are not. **Configuration management** solves this by writing down the desired state of each machine in files, and letting a tool make every server match it.

The best-known tools are Puppet, Chef and Ansible. Puppet and Chef usually install a small agent on each server that checks in regularly and corrects anything that has drifted from the description. Ansible needs no agent: it connects over SSH and runs tasks written in YAML files called playbooks. In all of them the steps are meant to be idempotent, so running them twice changes nothing the second time: "make sure `nginx` is installed" rather than "install `nginx`".

It is a close cousin of infrastructure as code. Tools like Terraform create the servers, networks and databases; configuration management sets up what runs inside them. With containers and golden images, many teams now bake the setup in before launch instead of fixing servers afterward, but configuration management is still everywhere, especially for fleets of long-lived machines.

## An analogy

Like a recipe with a photo of the finished dish: instead of each cook working from memory, everyone gets the same recipe, and a supervisor checks every plate against the photo and fixes the ones that look different.

## Keep in mind

- You describe the desired state; the tool makes each server match it.
- Puppet and Chef use agents; Ansible connects over SSH with no agent.
- Good tasks are idempotent: running them again changes nothing.
- Terraform builds the servers; configuration management sets them up.

## Go deeper

- [What is configuration management? (Red Hat)](https://www.redhat.com/en/topics/automation/what-is-configuration-management)
- [Ansible documentation](https://docs.ansible.com/)
- [Puppet (software) on Wikipedia](https://en.wikipedia.org/wiki/Puppet_(software))

## Related terms

- [Server](https://tidbit.legios.com.ar/server/): A computer whose job is to answer requests from other computers, all day, every day.
- [Vulnerability and CVE](https://tidbit.legios.com.ar/vulnerability-and-cve/): A flaw that lets an attacker misuse software, and the public id that names it.
- [AI agent](https://tidbit.legios.com.ar/ai-agent/): An LLM that can take actions, check the results and keep going until the job is done.
- [SSH](https://tidbit.legios.com.ar/ssh/): An encrypted way to log in to another computer and type commands on it.
- [Infrastructure as code](https://tidbit.legios.com.ar/infrastructure-as-code/): Describing servers, networks and databases in files instead of clicking.
- [Terraform](https://tidbit.legios.com.ar/terraform/): A popular tool for describing cloud infrastructure in files and creating it for you.
- [Database](https://tidbit.legios.com.ar/database/): An organized store of data that programs can search and update safely.
- [Container](https://tidbit.legios.com.ar/container/): A sealed box with a program and everything it needs to run anywhere.
