Ansible - Output YAML

Edit /etc/ansible/ansible.cfg:

# Use the YAML callback plugin.
stdout_callback = yaml
# Use the stdout_callback when running ad-hoc commands:
bin_ansible_callbacks = True

Sources:

  • https://www.jeffgeerling.com/blog/2018/use-ansibles-yaml-callback-plugin-better-cli-experience