top of page
Writer's pictureSiddhesh Kadam

Verbosity In Ansible

In Ansible, the verbose option is used to control the level of verbosity or detail in the output generated when running an Ansible playbook or ad-hoc command. It allows you to specify how much information is displayed during the execution of Ansible tasks. The verbose option can be set to one of the following levels:


1. -v (or --verbose): This is the default verbosity level. It provides a moderate amount of information about the tasks Ansible is performing. It shows task names and outputs of those tasks.

[root@siddhesh ~]# ansible-playbook -i inventory ping.yml -v

2. -vv (or --verbose --verbose): This increases the verbosity level to a higher degree. In this mode, Ansible provides more detailed information about the tasks, including variables, module options, and other details.

[root@siddhesh ~]# ansible-playbook -i inventory ping.yml -vv

3. -vvv (or --verbose --verbose --verbose): This is the highest verbosity level and is often used for debugging purposes. It displays extensive information, including the full JSON representation of tasks and modules.

[root@siddhesh ~]# ansible-playbook -i inventory ping.yml -vvv

You can use the verbose option with the ansible-playbook or ansible command to control the verbosity level. Here's an example of how to use it:

[root@siddhesh ~]# ansible -m ping -i inventory all -v

In this example, the -v flag is used to specify the default verbosity level. You can also use -vv or -vvv to increase the verbosity level as needed for debugging or troubleshooting.


When you want to know what Ansible is doing, identify problems, or confirm that the tasks and modules are being run, verbose output may be quite useful. But keep in mind that increased verbosity might produce a lot of output, which in certain situations could be too much. Increased verbosity should only be used in a responsible manner, particularly in production settings.




Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page