Ansible - Diaganostic

Card Puncher Data Processing

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 ]





Discover More
Card Puncher Data Processing
Ansible - Debug module

debug module diagnostic page With the ansible command line Example to get the ansible_host value where: ansible command line inventory is an inventory file -m set the module to debug -a...



Share this page:
Follow us:
Task Runner