Alek's Blog

Some Tips and Tricks for ansible

Updated:

You will find here some all day work tips for ansible

logging🔗

log-path or not🔗

I like to have several logs per ansible run. You can define a ANSIBLE_LOG_PATH in the Configuration file. It’s static and when several users run several playbooks or Ad-Hoc Commands you will have mixed entries in the log.

one log per ansible run🔗

The command below allows me to have one file per ansible run.

ANSIBLE_LOG_PATH=/tmp/ansible_log_$(date +%Y_%m_%d-%H_%M) \
ANSIBLE_DEBUG=True \
ansible-playbook -vvv your-playbook.yml

In the ansible documentation are more information about Enabling Networking logging and how to read the logfile