ansible-debug
Skill89 starsChanged 10 months agoMITView on GitHub
Use when playbooks fail with UNREACHABLE, permission denied, MODULE FAILURE, or undefined variable errors. Use when SSH connections fail or sudo password is missing.
In this repository3 other files it gives its agents.
- ansible-convertSkill
- ansible-interactiveSkill
- ansible-playbookSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 91
Start with -v, increase only if needed.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Ansible Debugging
Overview
Ansible errors fall into four categories: connection, authentication, module, and syntax. Systematic diagnosis starts with identifying the category, then isolating the specific cause.
When to Use
- UNREACHABLE errors (SSH/network issues)
- Permission denied or sudo password errors
- MODULE FAILURE messages
- Undefined variable errors
- Template rendering failures
- Slow playbook execution
Error Categories
| Category | Symptoms | First Check |
| Connection | UNREACHABLE | ssh -v user@host |
| Authentication | Permission denied, Missing sudo password | SSH keys, sudoers config |
| Module | MODULE FAILURE | Module parameters, target state |
| Syntax | YAML parse error | Line number in error, indentation |
Quick Diagnosis
Connection Errors
# Test SSH directly
ssh -v -i /path/to/key user@hostname
# Test port connectivity
nc -zv hostname 22
# Verify inventory parsing
ansible-inventory --host hostnameCommon causes:
- Wrong IP/hostname in inventory
- Firewall blocking port 22
- SSH key permissions (must be 600)
Authentication Errors
# Test with explicit options
ansible hostname -m ping -u user --private-key /path/to/key
# For sudo password issues, either:
ansible-playbook playbook.yml --ask-become-pass
# Or configure NOPASSWD in /etc/sudoersModule Errors
# Check module documentation
ansible-doc ansible.builtin.copy
# Verify module parameters match your Ansible version
ansible --versionVariable Errors
# Use default filter for optional variables
{{ my_var | default('fallback') }}
# Debug variable values
- ansible.builtin.debug:
var: problematic_variableVerbosity Levels
| Flag | Shows |
-v | Task results |
-vv | Task input parameters |
-vvv | SSH connection details |
-vvvv | Full plugin internals |
Start with -v, increase only if needed.
Debugging Commands
# Syntax check only
ansible-playbook --syntax-check playbook.yml
# Dry run
ansible-playbook --check playbook.yml
# Step through tasks
ansible-playbook --step playbook.yml
# Start at specific task
ansible-playbook --start-at-task "Task Name" playbook.yml
# Limit to specific host
ansible-playbook --limit hostname playbook.ymlCommon Error Patterns
| Error | Cause | Fix |
Permission denied (publickey) | SSH key not accepted | Check key permissions, verify authorized_keys |
Missing sudo password | become=true without password | Use --ask-become-pass or configure NOPASSWD |
No such file or directory | Path doesn't exist | Create parent directories first |
Unable to lock (apt/yum) | Package manager locked | Wait for other process, remove stale lock |
undefined variable | Variable not defined | Check spelling, use default() filter |
Performance Debugging
# ansible.cfg
[defaults]
callback_whitelist = profile_tasks # Show task timing
[ssh_connection]
pipelining = True # Faster SSH# Skip fact gathering if not needed
- hosts: all
gather_facts: noDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

