Interview Prep/Ansible/Vault, Privilege Escalation and Error Handling

What are callback plugins and how do you use them?

AdvancedConceptVault, Privilege Escalation and Error Handling
Answer

Callback plugins receive events during a run (task start, result, play recap) and either change the output (stdout callbacks) or do something extra (notification callbacks). Common ones: ansible.posix.profile_tasks (per-task timings), ansible.posix.timer, ansible.posix.json, and custom Slack or logging callbacks.

[defaults]
stdout_callback = ansible.builtin.default
callbacks_enabled = ansible.posix.profile_tasks, ansible.posix.timer

[callback_default]
result_format = yaml

Exactly one stdout callback is active. profile_tasks is the first thing we enable when a playbook is slow, since it ranks the slowest tasks.

All Ansible questions Roadmap: Ansible

More on Vault, Privilege Escalation and Error Handling