Concepts: Ansible
Stand: July 15, 2026
This concept reference collects the terms used across all workshop levels. It is written as a practical reference, not marketing material.
1. Control Node and Managed Nodes
Deep Dive and Submission Example for Control Node and Managed Nodes
A complete treatment of Control Node and Managed Nodes contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Control Node and Managed Nodes
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Control Node and Managed Nodes
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Control Node and Managed Nodes is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Control Node and Managed Nodes
This section is not just a definition. In the workshop, Control Node and Managed Nodes is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Control Node and Managed Nodes
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Control Node and Managed Nodes
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Control Node and Managed Nodes
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Control Node and Managed Nodes
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Control Node and Managed Nodes is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
2. Agentless Push Model
Deep Dive and Submission Example for Agentless Push Model
A complete treatment of Agentless Push Model contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Agentless Push Model
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Agentless Push Model
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Agentless Push Model is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Agentless Push Model
This section is not just a definition. In the workshop, Agentless Push Model is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Agentless Push Model
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Agentless Push Model
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Agentless Push Model
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Agentless Push Model
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Agentless Push Model is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
3. Inventory, Groups, and Patterns
Deep Dive and Submission Example for Inventory, Groups, and Patterns
A complete treatment of Inventory, Groups, and Patterns contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Inventory, Groups, and Patterns
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Inventory, Groups, and Patterns
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Inventory, Groups, and Patterns is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Inventory, Groups, and Patterns
This section is not just a definition. In the workshop, Inventory, Groups, and Patterns is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Inventory, Groups, and Patterns
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Inventory, Groups, and Patterns
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Inventory, Groups, and Patterns
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Inventory, Groups, and Patterns
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Inventory, Groups, and Patterns is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
4. Modules, Tasks, Plays, and Playbooks
Deep Dive and Submission Example for Modules, Tasks, Plays, and Playbooks
A complete treatment of Modules, Tasks, Plays, and Playbooks contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Modules, Tasks, Plays, and Playbooks
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Modules, Tasks, Plays, and Playbooks
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Modules, Tasks, Plays, and Playbooks is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Modules, Tasks, Plays, and Playbooks
This section is not just a definition. In the workshop, Modules, Tasks, Plays, and Playbooks is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Modules, Tasks, Plays, and Playbooks
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Modules, Tasks, Plays, and Playbooks
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Modules, Tasks, Plays, and Playbooks
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Modules, Tasks, Plays, and Playbooks
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Modules, Tasks, Plays, and Playbooks is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
5. Idempotence
Deep Dive and Submission Example for Idempotence
A complete treatment of Idempotence contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Idempotence
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Idempotence
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Idempotence is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Idempotence
This section is not just a definition. In the workshop, Idempotence is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Idempotence
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Idempotence
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Idempotence
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Idempotence
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Idempotence is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
6. Variables and Facts
Deep Dive and Submission Example for Variables and Facts
A complete treatment of Variables and Facts contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Variables and Facts
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Variables and Facts
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Variables and Facts is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Variables and Facts
This section is not just a definition. In the workshop, Variables and Facts is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Variables and Facts
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Variables and Facts
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Variables and Facts
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Variables and Facts
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Variables and Facts is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
7. Templates with Jinja2
Deep Dive and Submission Example for Templates with Jinja2
A complete treatment of Templates with Jinja2 contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Templates with Jinja2
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Templates with Jinja2
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Templates with Jinja2 is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Templates with Jinja2
This section is not just a definition. In the workshop, Templates with Jinja2 is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Templates with Jinja2
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Templates with Jinja2
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Templates with Jinja2
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Templates with Jinja2
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Templates with Jinja2 is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
8. Handlers and Notifications
Deep Dive and Submission Example for Handlers and Notifications
A complete treatment of Handlers and Notifications contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Handlers and Notifications
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Handlers and Notifications
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Handlers and Notifications is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Handlers and Notifications
This section is not just a definition. In the workshop, Handlers and Notifications is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Handlers and Notifications
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Handlers and Notifications
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Handlers and Notifications
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Handlers and Notifications
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Handlers and Notifications is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
9. Roles
Deep Dive and Submission Example for Roles
A complete treatment of Roles contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Roles
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Roles
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Roles is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Roles
This section is not just a definition. In the workshop, Roles is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Roles
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Roles
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Roles
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Roles
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Roles is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
10. Collections
Deep Dive and Submission Example for Collections
A complete treatment of Collections contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Collections
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Collections
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Collections is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Collections
This section is not just a definition. In the workshop, Collections is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Collections
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Collections
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Collections
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Collections
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Collections is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
11. Vault
Deep Dive and Submission Example for Vault
A complete treatment of Vault contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Vault
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Vault
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Vault is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Vault
This section is not just a definition. In the workshop, Vault is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Vault
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Vault
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Vault
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Vault
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Vault is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
12. Check Mode and Diff Mode
Deep Dive and Submission Example for Check Mode and Diff Mode
A complete treatment of Check Mode and Diff Mode contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Check Mode and Diff Mode
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Check Mode and Diff Mode
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Check Mode and Diff Mode is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Check Mode and Diff Mode
This section is not just a definition. In the workshop, Check Mode and Diff Mode is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Check Mode and Diff Mode
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Check Mode and Diff Mode
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Check Mode and Diff Mode
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Check Mode and Diff Mode
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Check Mode and Diff Mode is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
13. Failure States
Deep Dive and Submission Example for Failure States
A complete treatment of Failure States contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Failure States
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Failure States
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Failure States is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Failure States
This section is not just a definition. In the workshop, Failure States is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Failure States
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Failure States
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Failure States
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Failure States
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Failure States is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
14. Tags
Deep Dive and Submission Example for Tags
A complete treatment of Tags contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Tags
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Tags
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Tags is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Tags
This section is not just a definition. In the workshop, Tags is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Tags
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Tags
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Tags
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Tags
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Tags is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
15. Delegation and Orchestration
Deep Dive and Submission Example for Delegation and Orchestration
A complete treatment of Delegation and Orchestration contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Delegation and Orchestration
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Delegation and Orchestration
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Delegation and Orchestration is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Delegation and Orchestration
This section is not just a definition. In the workshop, Delegation and Orchestration is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Delegation and Orchestration
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Delegation and Orchestration
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Delegation and Orchestration
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Delegation and Orchestration
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Delegation and Orchestration is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
16. Ansible Boundaries
Deep Dive and Submission Example for Ansible Boundaries
A complete treatment of Ansible Boundaries contains both a technical artifact and a short domain explanation. The artifact can be an inventory, a playbook, a role, a template, a Vault file with dummy values, a CI configuration, or an evidence file. The explanation states why this path was chosen and which alternative was deliberately not used.
| Submission Part | Content | Minimum Quality |
|---|---|---|
| target description | what should be true after the run | measurable and without hidden assumptions |
| scope evidence | which hosts are affected | output from --list-hosts or inventory graph |
| implementation | which files were changed | small reviewable YAML files |
| validation | how it was checked | syntax check, check mode, diff, real run, second run |
| risk decision | what can go wrong | privileges, secrets, external dependencies, and rollback considered |
Minimal Artifacts for Ansible Boundaries
submission/
inventory/hosts.yml
playbooks/site.yml
evidence.md
cleanup.md
For roles or collections, the structure expands:
submission/
ansible.cfg
collections/requirements.yml
inventory/hosts.yml
roles/<role>/defaults/main.yml
roles/<role>/tasks/main.yml
roles/<role>/handlers/main.yml
playbooks/site.yml
evidence.md
Grading Expectation for Ansible Boundaries
A reviewable solution must be understandable to people who did not run it themselves. Screenshots or uncommented terminal output are not enough. Good evidence states context, command, relevant output, and assessment. If a module behaves differently in check mode, that limitation is explicitly documented.
Transfer to Real Teams
In a team context, Ansible Boundaries is connected to code review, branch rules, CI, role ownership, release notes, and operational approval. Production-like usage also documents ownership, maintenance window, monitoring, alerting, and rollback criteria.
Practical Relevance of Ansible Boundaries
This section is not just a definition. In the workshop, Ansible Boundaries is always validated through a concrete flow: inspect inventory, prove target hosts, check the playbook, simulate the change, run the change, evaluate a second run, and document cleanup. This shows whether Ansible really models desired state or merely executes a command successfully once.
| Review Question | Expected Answer |
|---|---|
| Which hosts are affected? | Pattern, group, --limit, and inventory output are documented. |
| Which data sources apply? | group_vars, host_vars, defaults, extra vars, and facts are known. |
| Which privileges are required? | become is close to the task and justified. |
| How is success proven? | Syntax check, check mode, diff, play recap, and second run are present. |
Example Flow for Ansible Boundaries
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --list-hosts
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
ansible-playbook -i inventory/hosts.yml playbooks/site.yml
The flow is intentionally complete. In real teams, some steps are automated but not skipped. CI can run syntax checks and linting; the domain review of scope, privileges, secret flows, and rollout risk remains a human engineering task.
Review Criteria for Ansible Boundaries
- Inventory and patterns are narrower than
allunless a reason is documented. - Modules from
ansible.builtinor reviewed collections are preferred. - Shell or command tasks include
changed_when,failed_when, or a clear reason. - Variables are placed predictably and do not override each other surprisingly.
- Secrets do not appear in plaintext, diffs, debug tasks, or CI logs.
- The playbook can run repeatedly without unnecessary changes.
- Cleanup, fix-forward, or controlled acceptance of the target state is documented.
Common Failure Modes for Ansible Boundaries
| Failure | Cause | Diagnosis |
|---|---|---|
| wrong hosts targeted | pattern or inventory misunderstood | --list-hosts, ansible-inventory --host |
unreachable |
SSH, user, Python, or network issue | -vvvv, SSH test, inventory variables |
| unexpected change | module not idempotent or wrong data source | second run, diff, variable inspection |
| secret leak | debug, diff, or log not scoped | check no_log, Vault, CI artifacts |
| handler does not run | no changed result or wrong handler name |
inspect task result and handler name |
Operations Note for Ansible Boundaries
For production-like usage, the lab must become a runbook. The runbook states target systems, owners, prerequisites, stop criteria, expected duration, validation, monitoring, and cleanup. Without those details, a playbook is executable but not operationally mature.
Ansible Boundaries is a practical building block of the Ansible workshop. The desired state must be described, executed against a controlled scope, and validated before and after the run. A solid Ansible workflow answers four questions: which hosts are targeted, which change is performed, which privileges are required, and how success is measured.
| Aspect | Workshop Meaning | Check |
|---|---|---|
| Scope | Inventory, pattern, --limit, tags, and environment select target systems. |
ansible-inventory --graph, ansible-playbook --list-hosts |
| State | Modules should model desired state and produce repeatable results. | second run without unnecessary changes |
| Privilege | become is used close to the task and justified. |
no broad global privilege without review |
| Evidence | Output, diffs, and summaries are documented. | play recap, diff, evidence file |
Typical commands:
ansible --version
ansible-config dump --only-changed
ansible-inventory -i inventory/hosts.yml --graph
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --check --diff
For reviews, a playbook is ready only when it proves its target scope, exposes its data sources, protects sensitive values, describes failure paths, and remains stable after a second run. If a module does not fully support check mode or diff mode, that limitation belongs in the runbook.
Common mistakes are broad patterns such as all, unclear variable sources, shell workarounds without idempotence, secrets in debug output, missing rollback notes, and missing separation between lab and production inventory.
Sources and Further References
- Official Ansible Community Documentation: https://docs.ansible.com/
- Ansible Getting Started: https://docs.ansible.com/projects/ansible/latest/getting_started/index.html
- Inventory Guide: https://docs.ansible.com/projects/ansible/latest/inventory_guide/index.html
- Playbook Guide: https://docs.ansible.com/projects/ansible/latest/playbook_guide/index.html
- Module Index: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/index.html
- Vault Guide: https://docs.ansible.com/projects/ansible/latest/vault_guide/index.html
- Ansible Lint: https://ansible.readthedocs.io/projects/lint/
- Molecule: https://ansible.readthedocs.io/projects/molecule/
- AWX: https://github.com/ansible/awx
- Red Hat Certifications: https://www.redhat.com/en/services/certifications