Debug Playbook Failures with Verbosity and Check Mode
Diagnose and fix Ansible playbook failures using increased verbosity levels, debug module, check mode, and step-by-step execution.
Prerequisites
- -Ansible installed
- -A playbook to debug
Steps
Run with increased verbosity
Shows SSH connection details, module arguments, and full return values. Use -vvvv for connection-level debugging.
Start with -v and increase verbosity only if you need more detail. -vvvv shows raw SSH commands.
Use the debug module
Add debug tasks in your playbook to print variable values: 'debug: var=my_variable' or 'debug: msg="Value is {{ my_var }}"'.
Run in step mode
Prompts you before each task with yes/no/continue, letting you step through the playbook interactively.
Start at a specific task
Skips all tasks before the named task. Useful when you know which task is failing.
Check for syntax errors
Validates YAML syntax and checks for common mistakes and best practice violations.
Full Script
FAQ
Discussion
Loading comments...