beautiful_output
Beautiful Output
This role ships with a callback plugin to allow you to display the execution of your playbook in a beautiful way (in my opinion.)
I was always obsessed about the looks of my terminal, and when I started using Ansible, there was no Callback available that looked good enough for my taste. Faced with such scenario, I spent some time to create this plugin to satisfy my "beautiful terminal" goal with Ansible.
It is worth notice that taste is a subjective point, and what looks good for me is not necessarily good for you.
Requirements
The control machine has to have the watchdog
python libraries installed prior
of running your playbook with this callback setup.
You can install it using pip:
$ pip install watchdog
Or add it to your requirements.txt
file.
If you're running this on a macOS, watchdog
requires the package AppKit
installed, but do not install it directly, add the PyObjC
and PyObjC-core
packages instead:
$ pip install PyObjC PyObjC-core
Dependencies
No dependency to any other Role.
How to use it
First, let Ansible know that you will use the plugin as an stdout_callback
plugin on your
ansible.cfg
file:
[defaults]
# Use the Beautiful Output callback plugin.
stdout_callback = beautiful_output
# Use the stdout_callback when running ad-hoc commands.
bin_ansible_callbacks = True
Then, for each playbook you want running with this callback plugin, add the role on the playbook file:
- hosts: servers
roles:
- role: townk.beautiful_output
Screenshots
Failure
Detail of a verbose failure
License
MIT License
Copyright (c) 2019 Thiago Alves
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ansible-galaxy install Townk/ansible-beautiful-output