About
This page gives information on how to debug a problem (diagnostic) for Ansible.
List
Increase the verbosity of the playbook command
Ansible - ansible-playbook cli verbosity can be given:
- at the command line:
anisble-playbook -v
anisble-playbook -vv # for more
anisble-playbook -vvv # for more
anisble-playbook -vvvv # to enable connection debugging
- via the environment variable ANSIBLE_DEBUG=1 to see detailed information
Use the log or debug module inside your playbook
Use tag to run or not debug task
- Tag: Example: The task will only run when the debug or never tag is explicitly requested. The never tag prevents a task from running unless a tag is specifically requested.
tasks:
- debug: msg="{{ showmevar }}"
tags: [ never, debug ]