linuxfabrik.lfops.compact (callback)¶
Compact output, one block per task, ok and skipped hosts summarized
Synopsis¶
- Prints one block per task, with the role and the task name on lines of their own.
- While the task runs, every host result appends an asterisk in the color of its status (ok, changed, skipped, failed, unreachable), so the asterisks add up to a progress bar.
- After the task, unchanged ok and skipped hosts are listed in one
okand oneskippedline. Host names that share the part up to the last dash and the delegation target are merged in bash brace expansion syntax, for exampleweb-{01,02} > localhost. - While a task runs, only the progress bar and failures are printed. At its end, the changed hosts follow, grouped by identical output (the diff, or without a diff the
msg,results,stdoutandstderrof the result, where modules report what they changed), then the output ofansible.builtin.debugtasks (seedisplay_debug_output), then the ok and skipped hosts, then the warnings. - Failed and unreachable results are printed as usual, with
msg,stdout,stderr,module_stdoutandmodule_stderras plain text below the JSON, so tracebacks stay readable. - Warnings are grouped by text and list the hosts they occurred on. A host name within a warning of Ansible itself (for example from a lookup) is replaced by
<host>for the grouping. - Failures that a task accepts with
ignore_errorsare shown in oneignoredline per message with the hosts, not as a full result (--verboseshows the full result). - At the end of the run, a report in Markdown lists each distinct message once with the hosts it occurred on, in sections by severity (FATAL, UNREACHABLE, WARNING, IGNORED, CHANGED), within a section one list per role (or playbook) with the task names in task order.
Available since LFOps 10.0.0.
Requirements¶
- set as stdout callback in the configuration
Optional Parameters¶
display_debug_output
- Show the output of
ansible.builtin.debugtasks, although their hosts are ok, grouped by identical output like the changes. If disabled, the hosts of aansible.builtin.debugtask are listed in theokline like those of any other task. - Type: Bool.
- Default:
true
Examples¶
# ansible.cfg
[defaults]
stdout_callback = linuxfabrik.lfops.compact
# ansible-navigator.yml
ansible-navigator:
execution-environment:
environment-variables:
set:
ANSIBLE_STDOUT_CALLBACK: 'linuxfabrik.lfops.compact'
Notes¶
- Under ansible-navigator, set the environment variable
ANSIBLE_STDOUT_CALLBACK. ansible-runner replaces the stdout callback with its own wrapper, which only builds on this variable and ignoresstdout_callbackinansible.cfg. The terminal needs at least 65 columns there, since ansible-runner writes 64 characters wide invisible event markers, which wrap and become visible on a narrower terminal, with any stdout callback. - Made for the linear strategies (
linear,mitogen_linear), which run one task on all hosts before the next. Withfreeorhost_pinned, the progress bar and the host lists of concurrent tasks mix.
Authors¶
- Linuxfabrik GmbH, Zurich, Switzerland, https://www.linuxfabrik.ch