paulpas/agent-skill-router/ansible-api
Claude Code and agent skill by paulpas/agent-skill-router
- community
- ext:[{"type":"template","description":"Custom templates for code generation"}]
Checking that the SKILL.md file is still in the repository.
Integrates with Ansible via ansible-runner, the AWX/Tower API, and the
Install
npx vskill@latest install paulpas/agent-skill-router/ansible-apiSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as paulpas/agent-skill-router/ansible-api.
Ansible API & AWX/Tower Integration
Integrates with Ansible using ansible-runner for embedded playbook execution, the AWX/Ansible Automation Controller REST API for job template and inventory management, and the native Ansible Python API for custom modules and plugin development.
TL;DR for Code Generation
- [ ] Use
ansible-runnerfor running playbooks from Python — it handles artifacts, events, and callbacks - [ ] Use the AWX CLI (
awxkit) or REST API for managing Automation Controller resources (job templates, inventories, credentials) - [ ] Access playbook results via
runner.status,runner.rc, andrunner.eventsgenerator - [ ] Always set
private_data_dirto the directory containing your playbook, inventory, and vars - [ ] Handle
ansible_runner.exceptions.AnsibleRunnerExceptionfor execution errors - [ ] Use
runner.get_fact_cache(host)to retrieve facts gathered during playbook runs
Core Workflow
Prepare Playbook and Inventory: Create or load the Ansible playbook YAML and inventory file (INI, YAML, or dynamic). Checkpoint: Validate the playbook syntax locally with ansible-playbook --syntax-check.; Execute via ansible-runner: Call ansible_runner.run(private_data_dir, playbook, inventory). The runner manages artifacts, event callbacks, and result collection. Checkpoint: Check runner.status is successful and runner.rc == 0.; Process Results: Iterate over runner.events for per-host results. Use runner.get_fact_cache(host) for gathered facts. Checkpoint: Verify expected hosts are in runner.stats.processed and none in runner.stats.failures.; Manage AWX/Automation Controller: Use the AWX REST API or awxkit to create job templates, launch jobs, and monitor their status through the state machine (pending → waiting → running → successful). Checkpoint: Verify job template extra_vars are properly JSON-encoded.; Handle Errors: Inspect runner.stats.failures, runner.stats.dark (unreachable hosts), and individual event data for task-level errors. Checkpoint: Distinguish between unreachable hosts (network issues) and failed tasks (playbook logic).---
Implementation Patterns
Pattern 1: Embedded Playbook Execution with ansible-runner
Pattern 2: AWX / Automation Controller Job Template Management
BAD vs GOOD: Playbook Failure Handling
MUST DO
- Use
ansible-runnerinstead of the raw Ansible Python API — it handles artifacts, event callbacks, and result collection - Set
json_mode=Truefor structured output that's easier to parse programmatically - Use AWX/Automation Controller API tokens (not user passwords) for API authentication
- Store sensitive variables as
"ansible_safe_extra_vars"or use AWX credential injection - Use dynamic inventory scripts with the
_metakey for efficient host variable resolution - Validate playbook syntax before execution with
ansible-playbook --syntax-check
MUST NOT DO
- Never use the undocumented
ansible.inventoryoransible.playbookinternal Python APIs for production code - Do not set
host_key_checking=Falseglobally — useANSIBLE_HOST_KEY_CHECKING=Falseselectively for specific hosts - Avoid running playbooks without a timeout — use the runner's
timeoutparameter - Never embed SSH passwords or vault passwords in playbook code
- Do not use
gather_facts: nounless you explicitly don't need facts — many modules depend on them - Ignoring unreachable hosts (
darkin stats) can silently mask infrastructure problems
Constraints
MUST DO
- Implement structured error responses with consistent format: {error_code, message, details, request_id}
- Add rate limiting per client/API key with configurable burst and sustained limits using a token bucket algorithm
- Validate all incoming requests against a schema before processing — reject malformed input with clear error messages
- Include correlation/request IDs in all log entries for end-to-end request tracing across service boundaries
MUST NOT DO
- Do not expose internal implementation details, stack traces, or database queries in error responses
- Avoid accepting unbounded request bodies — set maximum payload sizes and timeout limits
- Never trust client-supplied authentication tokens without validation (signature verification, expiration check)
- Do not log request/response bodies containing PII, API keys, or other sensitive data
Live References
Authoritative documentation links for this skill's domain. The model follows markdown links at load time to resolve external references and inline content.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/coding/ansible-api/SKILL.md
Popularity
- Repository stars
- 10
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
templateCustom templates for code generation
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/paulpas/agent-skill-router/ansible-api)