Skip to content

linuxfabrik.lfops.dashboard (callback)

Fixed full-screen view of a run, details at the end

Synopsis

  • Shows the run on one fixed screen that is updated in place instead of scrolling, at least once a second. At the top the playbook, the number of hosts and the elapsed time, the current role and task, a progress bar of the play with the estimated remaining time, then counters of the results of the current task and of the whole run. The ok counter of the task is followed by the number of hosts still at work on the task and the number of hosts, for example ok 13/22/35.
  • Below the title, where LFOps comes from - its version, or for a git checkout the branch, the commit and the number of uncommitted files, and the source path, shortened to the initials of its parent directories, when the checkout is mounted into an execution environment - and the ansible-core version. An LFOPS_EE_VERSION environment variable is shown as the EE version.
  • The progress bar counts the tasks of the play that are known when it starts, after --tags and --skip-tags are applied. A task included with include_tasks or include_role is one step, the bar stands still while the tasks it includes run. Tasks in rescue sections and handlers are not counted. The bar counts tasks, not time, and starts over with every batch of serial.
  • The estimated remaining time (ETA) adds up how long each step left took the last time it ran, an include with all its tasks, until the slowest host was done. The durations are kept in eta_cache_dir for the next runs, one file per step, so that runs in parallel, like several ansible-navigator sessions, do not wait for each other. A step that never ran before is assumed to take as long as the steps of this play so far did on average.
  • Below, the hosts are listed, sorted by their most severe result (fatal, warning, changed, ignored, ok), then by name, with their counts of fatal (F), warning (W), changed (C) and ok (O) results and their last notable result (LAST WORST), or the last ok result for a host without one. Hosts with only skipped results are counted, not listed.
  • At the end of the run, the screen is left and the details follow in the format of linuxfabrik.lfops.compact, but only for the tasks with changes, warnings or failures. Then the recap and the report of the distinct messages by severity.
  • Without a terminal (log file, pipe, CI) or with --verbose, the plugin behaves exactly like linuxfabrik.lfops.compact.

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.debug tasks, although their hosts are ok, grouped by identical output like the changes, with the other details at the end of the run. If disabled, the hosts of a ansible.builtin.debug task are listed in the ok line like those of any other task.
  • Type: Bool.
  • Default: true

eta_cache_dir

  • The directory where the durations of the steps are kept for the ETA of later runs, below /var/tmp/lfops, which the README asks ansible-navigator users to mount into the execution environment. The directory and its parent are created with mode 0700 and must belong to the user running Ansible, else the ETA is estimated from the current play only. An empty value does the same.
  • Type: Path.
  • Default: /var/tmp/lfops/dashboard

Examples

# ansible.cfg
[defaults]
stdout_callback = linuxfabrik.lfops.dashboard

# ansible-navigator.yml
ansible-navigator:
  execution-environment:
    environment-variables:
      set:
        ANSIBLE_STDOUT_CALLBACK: 'linuxfabrik.lfops.dashboard'

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 ignores stdout_callback in ansible.cfg.
  • The terminal needs at least 65 columns and 12 lines, else the plugin behaves like linuxfabrik.lfops.compact. ansible-runner writes 64 characters wide invisible event markers, which the screen keeps on its last line.
  • Keyboard input is not echoed while the screen is shown, so that a pressed key does not move it. Prompts (vars_prompt, pause) are not supported on the screen.
  • Made for the linear strategies (linear, mitogen_linear).

Authors

  • Linuxfabrik GmbH, Zurich, Switzerland, https://www.linuxfabrik.ch