/ansible-skills:ansible-debug [error-message]from ansible-skills
Debugs Ansible playbook failures including UNREACHABLE, permission denied, MODULE FAILURE, undefined variables, SSH connection issues, and sudo password errors with commands, verbosity levels, and fixes.
Ships in ansible-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Ansible errors fall into four categories: connection, authentication, module, and syntax. Systematic diagnosis starts with identifying the category, then isolating the specific cause.
| 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 |
# Test SSH directly
ssh -v -i /path/to/key user@hostname
# Test port connectivity
nc -zv hostname 22
# Verify inventory parsing
ansible-inventory --host hostname
Common causes:
# 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/sudoers
# Check module documentation
ansible-doc ansible.builtin.copy
# Verify module parameters match your Ansible version
ansible --version
# Use default filter for optional variables
{{ my_var | default('fallback') }}
# Debug variable values
- ansible.builtin.debug:
var: problematic_variable
| Flag | Shows |
|---|---|
-v | Task results |
-vv | Task input parameters |
-vvv | SSH connection details |
-vvvv | Full plugin internals |
Start with -v, increase only if needed.
# 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.yml
| 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 |
# 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: no
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cruftyoldsysadmin/ansible-skills --plugin ansible-skills4 skills in this plugin
/ansible-convertUse when converting shell scripts to Ansible playbooks. Use when migrating bash automation, manual procedures, or Dockerfiles to idempotent Ansible tasks./ansible-interactiveUse when guiding someone through Ansible setup step-by-step. Use when starting a new Ansible project from scratch. Use when teaching Ansible through hands-on development./ansible-playbookUse when creating playbooks, roles, or inventory files. Use when automating infrastructure with Ansible. Use when encountering YAML syntax errors, module failures, or variable precedence issues.Other plugins' skills for the same job