Ansible is a popular agent-less automation tool used to configure local or remote systems and deploy applications. The easiest way to install the latest version of Ansible on Ubuntu is to get it from the official APT repository. This short note shows how to install Ansible on Ubuntu, check its version, locate the configuration file […]
By default Ansible sends output of the plays, tasks and module arguments to STDOUT in the format that is not suitable for human reading. Starting from Ansible 2.5, the default output format can be changed to a human-readable using the callback plugin. This short note shows how to change the default Ansible’s JSON output format […]
It may be useful to run an Ansible playbook on a local system. For example for putting a playbook in a crontab or for a new host provisioning. In this note i am showing the several ways to run Ansible playbook locally.
During troubleshooting of Ansible issues it is useful to know how to enable debug mode and increase the level of verbosity. To enable debug and increase verbosity in Ansible you can pass the corresponding environment variables on the command line or define these settings in Ansible configuration file. Warning: The debug output can also include […]
In Ansible playbooks, it is often a good practice to test if a variable exists and what is its value. Particularity this helps to avoid different “VARIABLE IS NOT DEFINED” errors in Ansible playbooks. In this context there are several useful tests that you can apply using Jinja2 filters in Ansible. In this article, i’ll […]
During Ansible playbook debugging it is useful to know how to display host facts or registered variables. To print a message from Ansible playbook, as well as a value of a variable, we can use Ansible debug module. In the examples below i am showing how to print particular Ansible variables and how to list […]