You are reading an unmaintained version of the Ansible documentation. Unmaintained Ansible versions can contain unfixed security vulnerabilities (CVE). Please upgrade to a maintained version. See the latest Ansible documentation.
This module prints statements during execution and can be useful for debugging variables or expressions without necessarily halting the playbook. Useful for debugging together with the ‘when:’ directive.
This module is also supported for Windows targets.
# Example that prints the loopback address and gateway for each host-debug:msg:"System{{inventory_hostname}}hasuuid{{ansible_product_uuid}}"-debug:msg:"System{{inventory_hostname}}hasgateway{{ansible_default_ipv4.gateway}}"when:ansible_default_ipv4.gateway is defined-shell:/usr/bin/uptimeregister:result-debug:var:resultverbosity:2-name:Display all variables/facts known for a hostdebug:var:hostvars[inventory_hostname]verbosity:4
This module is flagged as stableinterface which means that the maintainers for this module guarantee that no backward incompatible interface changes will be made.
For more information about Red Hat’s this support of this module, please
refer to this knowledge base article<https://access.redhat.com/articles/rhel-top-support-policies>