ansible.builtin.tree callback – Save host events to files

Note

This callback plugin is part of ansible-core and included in all Ansible installations. In most cases, you can use the short plugin name tree. However, we recommend you use the Fully Qualified Collection Name (FQCN) ansible.builtin.tree for easy linking to the plugin documentation and to avoid conflicting with other collections that may have the same callback plugin name.

Callback plugin

This plugin is a notification callback. It sends information for a playbook run to other applications, services, or systems. See Callback plugins for more information on callback plugins.

Synopsis

  • This callback is used by the Ansible (adhoc) command line option -t|--tree.

  • This produces a JSON dump of events in a directory, a file for each host, the directory used MUST be passed as a command line option.

Requirements

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

  • invoked in the command line

Parameters

Parameter

Comments

directory

path

added in ansible-core 2.11

directory that will contain the per host JSON files. Also set by the --tree option when using adhoc.

Default: "~/.ansible/tree"

Configuration:

Note

Configuration entries listed above for each entry type (Ansible variable, environment variable, and so on) 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. The entry types are also ordered by precedence from low to high priority order. For example, an ansible.cfg entry (further up in the list) is overwritten by an Ansible variable (further down in the list).