Use this when keeping servers and devices in a declared state with Ansible, Puppet, Chef, Salt or DSC.
Configuration Management
Configuration management defines the desired state of servers and devices in code — Ansible, Puppet, Chef, Salt, DSC — and applies it repeatedly, so systems stay consistent and drift is corrected.
1. Configuration management keeps systems in a declared state.
2. Inventory, variables, templates, roles, idempotent modules.
3. Detect and correct drift.
4. Changes via review.
5. Report compliance.
repo (desired) → tool → hosts → report
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Target-state verification ladder Verify boundary
Configuration Management uses a strict target-state ladder for configuration convergence: request accepted → job/task succeeded → target object changed → effective runtime state confirmed → original workload verified.
Step 2 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as ambiguous target identity, stale inputs, partial success, unsafe retry, permission drift and confusing tool completion with target-evidence of the actual state, choosing the cases most relevant to desired-state declaration, inventory/target scope, idempotent convergence, change reporting and separating configuration success from service/application correctness.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Subtopics
Go one level deeper into this subject.
Configuration management fundamentals: describe the desired state in code, keep it in Git, apply it with a tool that is idempotent, and run it regularly so systems converge and stay consistent.
Subtopic Desired StateDesired state is the declared end configuration a system should have, such as package installed or service running.
Subtopic DriftDrift is when a system's actual configuration no longer matches the managed definition, usually because of manual changes, failed runs or other tools changing the same settings.
Subtopic Drift DetectionDrift detection in configuration management runs the tool in check mode or compares facts with the desired state on a schedule, reporting resources that would change.
Subtopic EnforcementEnforcement is applying the desired configuration repeatedly, such as every 30 minutes with Puppet or DSC ApplyAndAutoCorrect, so manual changes are automatically reverted.
Subtopic InventoryInventory in configuration management lists the managed nodes and groups them by role, environment or location, with variables that tailor the configuration each node receives.
Subtopic VariablesVariables in configuration management supply node- and group-specific values to roles and templates, with a defined precedence order.
Subtopic TemplatesTemplates in configuration management render config files from Jinja2, ERB or EPP templates with node variables, so one template produces the right file for every server.
Subtopic RolesRoles package related tasks, templates, files, variables and handlers into reusable units, such as an Ansible role for nginx, so a server's configuration is built from tested building blocks.
Subtopic ModulesModules are the units that do the work in configuration management, such as Ansible modules for packages or files, Puppet resources or DSC resources, each managing one kind of thing idempotently.
Subtopic IdempotencyIdempotency in configuration management means each resource or module only changes a system when it differs from the desired state, so runs can repeat without side effects and report 'ok' when nothing changed.
Subtopic Change ControlChange control in configuration management means configuration changes go through version control, review and approval before tools apply them, instead of being made directly on systems.
Subtopic Configuration Management TroubleshootingTroubleshoot configuration management by running in check or verbose mode, reading which resource or task failed, checking variable precedence, facts and inventory, and connectivity and privileges on the target.
- Declare the desired state; the tool works out the steps.
- Runs must be idempotent: 'ok' when nothing changes.
- Manual changes become drift.
ansible-playbook site.yml --check --diff— drift preview- Config repo history — changes
- Compliance report per host — state
ReferenceWhy it matters1 section · depth on demand
In depth
Configuration management is the discipline of keeping systems in a known, defined configuration throughout their life, with every change controlled and recorded. Tools such as Ansible, Puppet, Salt and DSC implement it by describing desired configuration in code and applying it repeatedly.
The topics in this group cover the core elements:
| Element | Purpose |
|---|---|
| Inventory | Which systems, grouped how |
| Modules | Idempotent units of work |
| Templates | Generate configuration from data |
| Idempotency | Safe repeated runs |
| Change control | Reviewed, tested, recorded changes |
The goal is that any system can be rebuilt to its correct configuration from code, and any difference between code and reality is visible.
ReferenceImportant terms & boundaries1 section · depth on demand
Mechanics
Follow the chain of components input → validation → controller/runtime → adapter/API → target system → verification/read-back and record which layer currently owns truth. The linked authority for bounded mechanics is Ansible Documentation — Ansible playbooks; documentation support is separate from observed lab/production Evidence.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Configuration Management. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_intro.html · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For desired-state declaration, inventory/target scope, idempotent convergence, change reporting and separating configuration success from service/application correctness, prefer typed fields and stable IDs over human presentation text.