Technotes

Technotes for future me

Better CLI experience

Ansible introduced callback plugins a while ago, but I just noticed there’s a new YAML callback plugin introduced with Ansible 2.5
meaning any machine running Ansible 2.5.0 or later can automatically start using this wonderfully-optimized-for-humans format,
without you needing to install a custom plugin on the machine, or include it with all your projects!

To use it, edit your ansible.cfg file (either global, in /etc/ansible/ansible.cfg,
or a local one in your playbook/project), and add the following lines under the [defaults] section:

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

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

Last updated on 31 Jan 2021
Published on 11 Dec 2019
Edit on GitHub