Callback Plugins Flashcards

1
Q

List the type of callback plugins in ansible

A
  • Stdout
  • notification
  • Aggregate
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is callback plugin?

A

plugins that can perform custom actions in response to Ansible events. Example of actions: a play starting, a task completing, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the role of stdout plugins?

A

Control the format of output displayed on terminals

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Can Ansible support multiple stdout plugins?

A

yes. However, only one stdout plugin can be active at a time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do specify the active stdout plugin?

A

Use the stdout_callback key in default section of ansible.cfg

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are examples of stdout callback plugins?

A
  • actionable
  • debug
  • default
  • dense
  • json
  • minimal
  • oneline
  • selective
  • skippy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the actionalble stdout plugin?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the debug stdout plugin?

A

A stdout callback plugin that makes it easier to read stdout and strderr returned by tasks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the dense stdout plugin?

A

A stdout callback plugin that always show only two lines of output. It overwrites the existing two lines instead of scrolling.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the json stdout plugin?

A

A stdout callback plugin that generates machine-readable json output. This plugin does not generate output until the entire playbook has finished executing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the minimal stdout plugin?

A

A stdout callback plugin that does very little processing of the event returned by the task.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the online stdout plugin?

A

Similar to minimal plugin but print everything on one line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the selective stdout plugin?

A

A stdout callback plugin that shows output only for 1) failed tasks and 2) successful tags that have the clause print_action

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the skippy stdout plugin?

A

A stdout callback plugin that doe snot show any output for hosts that are skipped.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what are example of actions performed by plugins other than the stdout callback plugin?

A
  • record execution time
  • send slack notification
  • send email
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Can I run multiple non-stdout plugins at the same time?

A

yes. only stdout plugins are restricted to have only one active at the same time.

17
Q

How do you configure callback plugins?

A

in ansible.cfg default section

callback_whitelist= mail, slack

18
Q

What is the typical way of setting config parameters for callback plugins?

A

environment variables

19
Q

List known callback plugin other than stdout plugins.

A
  • foreman
  • hipchat
  • jabber
  • junit
  • log_plays
  • logentries
  • logstash
  • mail
  • slack
  • timer
  • osx_say
  • profile_tasks
20
Q

What is the foreman plugin?

A

A callback plugin that sends notifications to foreman

21
Q

What is the hipchat plugin?

A

A callback plugin that sends notifications to hipchat

22
Q

What is the jabber plugin?

A

A callback plugin that sends notifications using the xmpp protocol

23
Q

What is the junit plugin?

A

A callback plugin that writes the result of playbook execution to XML file in Junit format (pass, error,skipped, failure)

24
Q

What is the log_palys plugin?

A

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.

25
Q

What is the logentries plugin?

A

A callback plugin that sends results to logentries.

26
Q

What is the logstash plugin?

A

A callback plugin that writes results to logstash

27
Q

What is the mail plugin?

A

A callback plugin that sends email whenever a task fails on a host

28
Q

What is the osx_say plugin?

A

A callback plugin that uses the say program to send notifications to OSX

29
Q

What is the profile_tasks plugin?

A

A callback plugin that generates a summary excution of individual tasks and toytal execution time

30
Q

What is the slack plugin?

A

A callback plugin that sends notification to slack

31
Q

What is the timer plugin?

A

A callback plugin that outputs the total execution time of the playbook

32
Q

What do you prefer, timer plugin or profile_task?

A

profile_task because it already includes the information that timer displays, namely the total execution time of the playbook.