Ansible: Human-Readable Output Format

By default Ansible sends output of the plays, tasks and module arguments to STDOUT in the format that is not suitable for human reading.

Starting from Ansible 2.5, the default output format can be changed to a human-readable using the callback plugin.

This short note shows how to change the default Ansible’s JSON output format to the more human-friendly YAML format.

Cool Tip: Enable DEBUG mode and increase VERBOSITY in Ansible! Read more →

Ansible Output Format

To change the Ansible’s output format you can pass the ANSIBLE_STDOUT_CALLBACK=yaml environment variable on the command line or define the stdout_callback = yaml in Ansible configuration file.

Run a playbook and get the output in the human-readable format:

$ ANSIBLE_STDOUT_CALLBACK=yaml ansible-playbook playbook.yml

You can also define the stdout_callback = yaml in ansible.cfg:

[defaults]
# Human-readable output
stdout_callback = yaml

Cool Tip: Ansible Playbook – Print Variable & List All Variables! Read more →