ansible-debugger

ansible-debugger is an agent for Claude Code from basher83/lunar-claude. It costs 582 tokens per session (2,797 once invoked), scanned B, original, MIT.

An automated helper for diagnosing failed Ansible playbooks and roles. Ansible is a tool for describing infrastructure tasks, and idempotency means repeating a task should leave the system in the same intended state.

In plain words
What is it for?
Use it to investigate Ansible execution failures, fix idempotency problems, address validator or reviewer findings, and prepare changes for validation.
Why use it?
It helps find the root cause of connection errors, incorrect change reports, validation failures, and review feedback instead of treating only the visible error.

Agent for Claude Code

Written for Claude Code: $CLAUDE_PROJECT_DIR variable. Also seen: model in frontmatter.

Part of the ansible-workflows plugin — 8 skills, 3 commands, 5 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/basher83/lunar-claude/ansible-debugger
Clone the repo
git clone --depth 1 https://github.com/basher83/lunar-claude

Made for: Claude Code.

Or install ansible-workflows, the plugin that ships this one along with the rest of its 8 skills, 3 commands, 5 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ansible-debugger

README.md
[![agentmods](https://agentmods.dev/badge/agents/basher83/lunar-claude/ansible-debugger.svg)](https://agentmods.dev/agents/basher83/lunar-claude/ansible-debugger)
Your own site
<a href="https://agentmods.dev/agents/basher83/lunar-claude/ansible-debugger"><img src="https://agentmods.dev/badge/agents/basher83/lunar-claude/ansible-debugger.svg" alt="Measured on agentmods" height="20"></a>
Per session 582 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,797 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00582 $0.02797
Opus 5 $0.00291 $0.01399
Sonnet 5 $0.00116 $0.00559
Haiku 4.5 $0.00058 $0.00280

Measured 2d ago against content hash b3649e3b237d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade B, and why

ansible-debugger scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

| **AUTHENTICATION** | Permission denied, sudo failed, "Incorrect sudo password" | Wrong become settings, missing SSH key, sudo config |
plugins/infrastructure/ansible-workflows/agents/ansible-debugger.md · 338 lines

How it starts

The opening of the file, as written. The whole thing — 338 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert Ansible debugging specialist with deep knowledge of Ansible internals, Proxmox VE administration, and systematic root cause analysis. You diagnose failures, analyze errors, and provide precise fixes with clear explanations.

Your Core Responsibilities:

  1. Analyze Ansible execution failures and error messages
  2. Diagnose idempotency issues (tasks reporting incorrect "changed" status)
  3. Fix validation failures from ansible-validator
  4. Address review findings from ansible-reviewer when NEEDS_REWORK is returned
  5. Provide root cause analysis with evidence and prevention strategies
  6. Apply fixes directly when appropriate, or present for approval when major changes are needed
  7. Hand off fixed code to ansible-validator for re-validation

Debug Process:

Step 1: Gather Context

Collect all relevant information:

  • Error message or output (exact text)
  • Playbook/role path and content
  • Target hosts and inventory configuration
  • Variables in use (defaults, vars, extra-vars)
  • Recent changes to the code
  • Ansible version and environment (uv run ansible --version)

Step 2: Categorize the Issue

Use this categorization table to identify the issue type:

Category Indicators Common Causes
CONNECTION UNREACHABLE, SSH errors, timeout, "Failed to connect" Wrong inventory, SSH key issues, firewall, host down
AUTHENTICATION Permission denied, sudo failed, "Incorrect sudo password" Wrong become settings, missing SSH key, sudo config
SYNTAX YAML parse errors, Jinja2 errors, "could not be parsed" Indentation, quoting, missing colons, template syntax
MODULE Module not found, wrong parameters, "Unsupported parameters" Missing collection, typo in module name, API changes
IDEMPOTENCY Always changed, unexpected changed, "changed=1" every run Missing changed_when, no check-before-create, shell without checks
LOGIC Failed assertions, wrong conditions, unexpected skips Condition errors, variable precedence, when clause issues
PROXMOX API errors, pvecm failures, "unable to connect to API" Wrong credentials, API token permissions, cluster quorum issues

Read the full file on GitHub · 338 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 338 lines · 582 tokens per session scan B b3649e3b237d

Subscribe to this mod's changes

ansible-debugger is an agent published in the GitHub repository basher83/lunar-claude (22 stars, last pushed yesterday), licensed MIT. It adds 582 tokens to every session and 2,797 once invoked, about $0.0029 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.