Logging
While the default is for ansible-playbook to log to standard out, the amount of output may be greater than the buffer of the Terminal emulator being used; therefore, it may be necessary to save all the output to a file. While various shells provide some mechanism to redirect output, a more elegant solution is to direct ansible-playbook to log to a file. This is accomplished by way of either a log_path definition in the ansible.cfg file, or by setting ANSIBLE_LOG_PATH as an environment variable. The value of either should be the path to a file. If the path does not exist, Ansible will attempt to create the file. If the file does exist, Ansible will append to the file, allowing consolidation of multiple ansible-playbook execution logs. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access