DevOps Practitioner · Module 5: Ansible and configuration management · Lab
Render Configs for Different Targets, Review, Apply
45 min hands-on · Core
A control machine with the demo role; two learner-owned lab targets in different groups with different variables. No apply before review.
Local guide: run the steps below on your own machine in order, then check the validation list.
Objectives
- Render per-target config from one role and diff the outputs
- Review with check mode and diff before touching any target
- Apply group by group with verification between
Step 1
Render both targets
Render the role's templates for both targets without applying. Diff the two outputs and quote the lines that differ with the variables that produced them.
Step 2
Review in check mode
Run the role in check mode with diff against the first group. Quote the predicted changes and confirm they match the intended differences, nothing more.
Step 3
Apply in stages
Apply to the first group, verify the service, then apply to the second. Record the staged order and the verification after each stage.
How to confirm it worked
- Rendered diff quoted with producing variables
- Check-mode prediction matches intent exactly
- Staged apply with per-stage verification recorded