ansible.posix.jsonl callback – Ansible screen output as JSONL (lines in json format)

Note

This callback plugin is part of the ansible.posix collection (version 1.6.2).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install ansible.posix. You need further requirements to be able to use this callback plugin, see Requirements for details.

To use it in a playbook, specify: ansible.posix.jsonl.

Callback plugin

This plugin is a stdout callback. You can use only use one stdout callback at a time. Additional aggregate or notification callbacks can be enabled though. See Callback plugins for more information on callback plugins.

Synopsis

  • This callback converts all events into JSON output to stdout

  • This callback in contrast with ansible.posix.json uses less memory, because it doesn’t store results.

Requirements

The below requirements are needed on the local controller node that executes this callback.

  • Set as stdout in config

Parameters

Parameter

Comments

json_indent

integer

If specified, use this many spaces for indenting in the JSON output. If not specified or <= 0, write to a single line.

Default: 0

Configuration:

show_custom_stats

boolean

This adds the custom stats set via the set_stats plugin to the play recap

Choices:

  • false ← (default)

  • true

Configuration:

Notes

Note

  • When using a strategy such as free, host_pinned, or a custom strategy, host results will be added to new task results in ``.plays[].tasks[]``. As such, there will exist duplicate task objects indicated by duplicate task IDs at ``.plays[].tasks[].task.id``, each with an individual host result for the task.

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.