Some Tips and Tricks for ansible

Some Tips and Tricks for ansible

Created:
Updated:
129 words Β· 1 minute reading time

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