Callback Plugins Flashcards
List the type of callback plugins in ansible
- Stdout
- notification
- Aggregate
What is callback plugin?
plugins that can perform custom actions in response to Ansible events. Example of actions: a play starting, a task completing, etc.
What is the role of stdout plugins?
Control the format of output displayed on terminals
Can Ansible support multiple stdout plugins?
yes. However, only one stdout plugin can be active at a time.
How do specify the active stdout plugin?
Use the stdout_callback key in default section of ansible.cfg
What are examples of stdout callback plugins?
- actionable
- debug
- default
- dense
- json
- minimal
- oneline
- selective
- skippy
What is the actionalble stdout plugin?
A stdout callback plugin that shows output only if the task changes the state of the managed node or fails. This makes output less noisy.
What is the debug stdout plugin?
A stdout callback plugin that makes it easier to read stdout and strderr returned by tasks.
What is the dense stdout plugin?
A stdout callback plugin that always show only two lines of output. It overwrites the existing two lines instead of scrolling.
What is the json stdout plugin?
A stdout callback plugin that generates machine-readable json output. This plugin does not generate output until the entire playbook has finished executing.
What is the minimal stdout plugin?
A stdout callback plugin that does very little processing of the event returned by the task.
What is the online stdout plugin?
Similar to minimal plugin but print everything on one line
What is the selective stdout plugin?
A stdout callback plugin that shows output only for 1) failed tasks and 2) successful tags that have the clause print_action
What is the skippy stdout plugin?
A stdout callback plugin that doe snot show any output for hosts that are skipped.
what are example of actions performed by plugins other than the stdout callback plugin?
- record execution time
- send slack notification
- send email
Can I run multiple non-stdout plugins at the same time?
yes. only stdout plugins are restricted to have only one active at the same time.
How do you configure callback plugins?
in ansible.cfg default section
callback_whitelist= mail, slack
What is the typical way of setting config parameters for callback plugins?
environment variables
List known callback plugin other than stdout plugins.
- foreman
- hipchat
- jabber
- junit
- log_plays
- logentries
- logstash
- slack
- timer
- osx_say
- profile_tasks
What is the foreman plugin?
A callback plugin that sends notifications to foreman
What is the hipchat plugin?
A callback plugin that sends notifications to hipchat
What is the jabber plugin?
A callback plugin that sends notifications using the xmpp protocol
What is the junit plugin?
A callback plugin that writes the result of playbook execution to XML file in Junit format (pass, error,skipped, failure)
What is the log_palys plugin?
A callback plugin that logs the result to log files, one log file per host at /etc/log/ansible/hosts. This location can be changed in ansible.cfg with log_path.
What is the logentries plugin?
A callback plugin that sends results to logentries.
What is the logstash plugin?
A callback plugin that writes results to logstash
What is the mail plugin?
A callback plugin that sends email whenever a task fails on a host
What is the osx_say plugin?
A callback plugin that uses the say program to send notifications to OSX
What is the profile_tasks plugin?
A callback plugin that generates a summary excution of individual tasks and toytal execution time
What is the slack plugin?
A callback plugin that sends notification to slack
What is the timer plugin?
A callback plugin that outputs the total execution time of the playbook
What do you prefer, timer plugin or profile_task?
profile_task because it already includes the information that timer displays, namely the total execution time of the playbook.