Use this when choosing or writing configuration modules.
Modules · Configuration Management
Modules 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.
1. Modules perform actions idempotently.
2. Use specific modules (package, service, template) over shell.
3. FQCN names (ansible.builtin.x).
4. Check return values.
5. Custom modules for gaps.
task → module → change/no change
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 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as inventory drift, variable precedence surprises, template rendering errors, non-idempotent modules, partial convergence and green task status with unhealthy service, choosing the cases most relevant to module name/namespace/revision, imports/includes, revision selection and capability exposure to clients.
Step 2 Common mistakes Narrow the fault
shell:for things a module can do.- Unpinned collection versions.
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.
- Each module manages one kind of resource idempotently.
- Prefer modules over shell commands.
- Pin collection or module versions.
ansible-doc <module>— module docsansible-doc -l | wc -l— available modules- Prefer modules over shell/command — idempotency
ReferenceWhy it matters1 section · depth on demand
What it is
Modules are the units that do the work (Ansible modules, Puppet resources). Use idempotent, vendor-maintained modules instead of command/shell.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Modules are the units that perform work in configuration management tools — install a package, manage a file, configure VLANs on a switch. Each module encapsulates platform details and implements idempotency, so playbooks or manifests describe intent rather than commands.
| Tool | Unit | Example |
|---|---|---|
| Ansible | Module | cisco.ios.ios_vlans, ansible.builtin.package |
| Puppet | Resource type | package, service, file |
| Salt | State module | pkg.installed |
| DSC | Resource | WindowsFeature |
Prefer resource modules (structured, idempotent, support state: merged/replaced/overridden) over raw command modules (command, shell, ios_command for config), which cannot tell whether a change is needed.
Example
ansible-doc cisco.ios.ios_config
ansible-doc -l | grep -i netbox
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 > Modules. 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 module name/namespace/revision, imports/includes, revision selection and capability exposure to clients, prefer typed fields and stable IDs over human presentation text.