Skip to content

arbabnazar/ansible_stdout_compact_logger

 
 

Repository files navigation

Ansible Stdout Compact Logger

Installation

  • put somewhere on your disk
  • add callback_plugins settings in your [defaults] settings in your ansible configuration
  • change stdout_callback to anstomlog

cf ansible.cfg.

Features

  • one-line display
  • pylint compatible (almost...)
  • displays tasks content in a nice way
  • indents structs, displays empty arrays, strings
  • puts fields on top when available ['stdout', 'rc', 'stderr', 'start', 'end', 'msg']
  • removes some fields when present ['stdout', 'stdout_lines', 'rc', 'stderr', 'start', 'end', 'msg'] to avoid too much clutter
  • reverts to standard logger when more than vv verbosity
  • supports no_log attribute in Task
  • supports _ansible_verbose_always and _ansible_verbose_override
  • supports multiple items in task (#1)
  • multi host support
  • correct duration computation
  • diff display support
  • displays stdout and stderr nicely even when they contain \n
  • better line colouring
  • more test around curious errors

Stdout Display with multiline outputs

Test the logger

  • clone this repository
ansible-playbook test-1.yml
  • to run the tests, call python2.6 callbacks/anstomlog.py

License

MIT, see LICENSE file.

About

Ansible Stdout Compact Logger

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%