Chapter #12: Ansible Troubleshooting
This is the twelfth and the last chapter of the RHCE Ansible EX294 exam preparation series. You'll learn about troubleshooting Ansible in this article.
We all dream of a world where we never make mistakes or errors while running our Ansible playbooks.
In reality, such world doesnβt exist and so you need to have troubleshooting skills, so you are ready to deal with errors in your playbooks.
In this tutorial, you will learn how to enable logging in your playbooks. You will also learn a few other Ansible modules that can help you with troubleshooting. Finally, you will learn how to troubleshoot connectivity issues in Ansible.
Enable Ansible logging
By default, Ansible is not configured to log its output anywhere. You can however this behavior by setting the log_path configuration setting in your Ansible configuration file (ansible.cfg) to allow Ansible to log its output to a specific destination.
To demonstrate, letβs first set log_path in ansible.cfg:
This would enable Ansible playbooks and ad-hoc commands to log its output to a file named playbooks.log in your project directory.
A Linux sysadmin who likes to code for fun. I have authored Learn Linux Quickly book to help people learn Linux easily. I also like watching the NBA and going for a cruise with my skateboard.