I’ve just pushed some upgrades that allow for optional logging of all ansible and ansible-playbook output.
To configure this, set ‘log_path’ in your configuration file or ANSIBLE_LOG_PATH as an environment variable.
Dates and times of each log message are printed before the message.
It will also output the commands you run ahead of each output block.
This file will get somewhat large over time so you’ll probably want to
configure logrotate if you are using it.
very cool! i noticed if i’m running two playbooks simultaneously the output (obviously) gets interleaved and i can’t tell which line is coming from which execution… i put together a patch to stick the pid of the running ansible-playbook process between the date and the message; i want to test it a bit, but would you accept a pull request for something like this?
https://github.com/mcodd/ansible/commit/3b8f69bac8feb8d3a9fc17c4a57ca0a1237014f4
thanks,
matt
Yes, please send a pull request along for this.
BTW, be sure to handle the case where logging is configured off.