Security: Ansible
Stand: July 15, 2026
This security reference treats Ansible as a privileged change path. It focuses on scope control, least privilege, secrets, supply chain, logs, CI, and platform operation.
1. Threat Model
Deep Dive and Submission Example for Threat Model
A complete treatment of Threat 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 Threat 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 Threat 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, Threat 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 Threat Model
This section is not just a definition. In the workshop, Threat 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 Threat 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 Threat 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 Threat 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 Threat 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.
Threat 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.
2. Assets and Attack Surfaces
Deep Dive and Submission Example for Assets and Attack Surfaces
A complete treatment of Assets and Attack Surfaces 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 Assets and Attack Surfaces
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 Assets and Attack Surfaces
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, Assets and Attack Surfaces 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 Assets and Attack Surfaces
This section is not just a definition. In the workshop, Assets and Attack Surfaces 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 Assets and Attack Surfaces
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 Assets and Attack Surfaces
- 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 Assets and Attack Surfaces
| 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 Assets and Attack Surfaces
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.
Assets and Attack Surfaces 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 Risks
Deep Dive and Submission Example for Inventory Risks
A complete treatment of Inventory Risks 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 Risks
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 Risks
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 Risks 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 Risks
This section is not just a definition. In the workshop, Inventory Risks 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 Risks
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 Risks
- 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 Risks
| 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 Risks
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 Risks 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. Credential Risks
Deep Dive and Submission Example for Credential Risks
A complete treatment of Credential Risks 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 Credential Risks
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 Credential Risks
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, Credential Risks 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 Credential Risks
This section is not just a definition. In the workshop, Credential Risks 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 Credential Risks
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 Credential Risks
- 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 Credential Risks
| 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 Credential Risks
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.
Credential Risks 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. Privilege Escalation
Deep Dive and Submission Example for Privilege Escalation
A complete treatment of Privilege Escalation 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 Privilege Escalation
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 Privilege Escalation
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, Privilege Escalation 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 Privilege Escalation
This section is not just a definition. In the workshop, Privilege Escalation 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 Privilege Escalation
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 Privilege Escalation
- 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 Privilege Escalation
| 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 Privilege Escalation
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.
Privilege Escalation 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. Secrets and Vault
Deep Dive and Submission Example for Secrets and Vault
A complete treatment of Secrets and 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 Secrets and 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 Secrets and 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, Secrets and 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 Secrets and Vault
This section is not just a definition. In the workshop, Secrets and 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 Secrets and 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 Secrets and 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 Secrets and 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 Secrets and 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.
Secrets and 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.
7. No-log and Diff Risks
Deep Dive and Submission Example for No-log and Diff Risks
A complete treatment of No-log and Diff Risks 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 No-log and Diff Risks
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 No-log and Diff Risks
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, No-log and Diff Risks 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 No-log and Diff Risks
This section is not just a definition. In the workshop, No-log and Diff Risks 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 No-log and Diff Risks
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 No-log and Diff Risks
- 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 No-log and Diff Risks
| 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 No-log and Diff Risks
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.
No-log and Diff Risks 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. Supply Chain
Deep Dive and Submission Example for Supply Chain
A complete treatment of Supply Chain 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 Supply Chain
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 Supply Chain
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, Supply Chain 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 Supply Chain
This section is not just a definition. In the workshop, Supply Chain 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 Supply Chain
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 Supply Chain
- 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 Supply Chain
| 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 Supply Chain
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.
Supply Chain 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. Collections and Roles
Deep Dive and Submission Example for Collections and Roles
A complete treatment of Collections and 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 Collections and 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 Collections and 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, Collections and 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 Collections and Roles
This section is not just a definition. In the workshop, Collections and 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 Collections and 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 Collections and 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 Collections and 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 Collections and 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.
Collections and 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. CI Security
Deep Dive and Submission Example for CI Security
A complete treatment of CI Security 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 CI Security
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 CI Security
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, CI Security 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 CI Security
This section is not just a definition. In the workshop, CI Security 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 CI Security
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 CI Security
- 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 CI Security
| 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 CI Security
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.
CI Security 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. AWX/AAP RBAC
Deep Dive and Submission Example for AWX/AAP RBAC
A complete treatment of AWX/AAP RBAC 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 AWX/AAP RBAC
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 AWX/AAP RBAC
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, AWX/AAP RBAC 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 AWX/AAP RBAC
This section is not just a definition. In the workshop, AWX/AAP RBAC 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 AWX/AAP RBAC
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 AWX/AAP RBAC
- 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 AWX/AAP RBAC
| 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 AWX/AAP RBAC
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.
AWX/AAP RBAC 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. Execution Environments
Deep Dive and Submission Example for Execution Environments
A complete treatment of Execution Environments 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 Execution Environments
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 Execution Environments
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, Execution Environments 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 Execution Environments
This section is not just a definition. In the workshop, Execution Environments 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 Execution Environments
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 Execution Environments
- 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 Execution Environments
| 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 Execution Environments
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.
Execution Environments 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. Windows and Network Automation
Deep Dive and Submission Example for Windows and Network Automation
A complete treatment of Windows and Network Automation 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 Windows and Network Automation
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 Windows and Network Automation
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, Windows and Network Automation 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 Windows and Network Automation
This section is not just a definition. In the workshop, Windows and Network Automation 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 Windows and Network Automation
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 Windows and Network Automation
- 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 Windows and Network Automation
| 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 Windows and Network Automation
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.
Windows and Network Automation 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. Incident Response
Deep Dive and Submission Example for Incident Response
A complete treatment of Incident Response 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 Incident Response
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 Incident Response
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, Incident Response 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 Incident Response
This section is not just a definition. In the workshop, Incident Response 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 Incident Response
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 Incident Response
- 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 Incident Response
| 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 Incident Response
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.
Incident Response 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. Security Checklist
Deep Dive and Submission Example for Security Checklist
A complete treatment of Security Checklist 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 Security Checklist
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 Security Checklist
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, Security Checklist 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 Security Checklist
This section is not just a definition. In the workshop, Security Checklist 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 Security Checklist
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 Security Checklist
- 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 Security Checklist
| 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 Security Checklist
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.
Security Checklist 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