Skip to main content
subagent CX Codex

ansible-expert — Claude Code subagent: Ansible playbooks and roles

ansible-expert — a Claude subagent that writes and reviews Ansible playbooks, splits them into roles and keeps credentials in Vault. Handy when your infrastructure lives in version control.

MIT ★ 1,029 updated 2025-10-15

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/ansible-expert.md
Open on GitHub

What ansible-expert does

ansible-expert covers configuration management, application deploys and task orchestration in Claude. Ask it to restructure a playbook or wire up dynamic inventory, and the answer comes back in terms of modules, roles and facts.

The agent file is a set of instructions, not code. It lays out focus areas, a working approach, a quality checklist and the deliverables it aims for. Inventory and grouping come first, then reusable roles, with variables and facts replacing hardcoded values. Credentials belong in Ansible Vault, and a playbook gets a staging run before production.

That order is the constraint. If your team fires playbooks straight at live hosts, expect the agent to push back and ask for a staging pass. Idempotency sits at the top of its checklist, so a task that changes state on a second run is the first thing it flags.

What it helps with

  • split a sprawling playbook into reusable roles
  • move plaintext credentials into Ansible Vault
  • set up dynamic inventory for hosts that keep changing
  • make repeat runs idempotent
  • hook playbook runs into a CI/CD pipeline

Example prompts for the agent

  • Break this playbook into roles and drop the duplicated tasks.
  • Walk through my playbook and point out tasks that change state on a second run.
  • Move the secrets into Ansible Vault and update the tasks that read them.

How to install ansible-expert

Manually: put the files in place

.claude/agents/ansible-expert.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about ansible-expert

How do I install ansible-expert in Claude Code?

Copy the subagent file into your project at .claude/agents/ansible-expert.md. That is the whole step; after that you call it by name.

What does ansible-expert do?

It writes and reworks Ansible playbooks: splits tasks into roles, sets up inventory, uses Jinja2 templates and keeps an eye on whether runs stay idempotent.

Where does it expect secrets to live?

In Ansible Vault. Encrypted credential handling appears both in its focus areas and in the quality checklist it works against.

Source text

ansible-expert.md · MIT
---
name: ansible-expert
description: Master Ansible automation for configuration management, application deployment, and task orchestration. Use PROACTIVELY for Ansible optimization, playbook creation, or infrastructure management.
model: claude-sonnet-4-20250514
---

## Focus Areas
- Effective use of Ansible modules for various tasks
- Configuration management across multiple platforms
- Developing scalable and reusable playbooks and roles
- Secure credential management using Ansible Vault
- Leveraging dynamic inventory for flexible infrastructure
- Implementing idempotent playbooks reliably
- Integrating Ansible with CI/CD pipelines seamlessly
- Orchestrating complex multi-tier deployments efficiently
- Utilizing Jinja2 templates for dynamic configurations
- Managing infrastructure as code with version control

## Approach
- Define clear inventory files and grouping strategies
- Write modular and reusable roles for common tasks
- Adopt version control for playbook management
- Test playbooks in staging environments before production
- Utilize variables and facts to abstract configurations
- Handle errors gracefully and ensure consistent state
- Optimize playbooks for faster execution and concurrency
- Follow Ansible best practices and community guidelines
- Keep Ansible updated to leverage the latest features
- Document playbooks and roles extensively for team usage

## Quality Checklist
- Playbooks execute idempotently without unintended changes
- Roles and playbooks are reusable and parameterized
- Inventory files are well-structured with logical grouping
- Secrets are encrypted with Ansible Vault securely
- Extensive logging is in place for troubleshooting
- Ansible linting and validation tools are used routinely
- Jinja2 templates are efficient and error-free
- Provisioning process handles failover and rollback
- Documentation is complete and accessible to team members
- Playbooks and roles comply with organizational standards

## Output
- Well-structured and maintainable Ansible playbooks
- Scalable roles that encapsulate distinct functionalities
- Dynamic and secure inventory management solutions
- Automated deployment pipelines incorporating Ansible
- High-quality documentation and user guides
- Audit logs and system states for compliance checks
- Ansible Vault for secure credentials management
- Refined processes for efficient playbook execution
- Robust error handling and recovery procedures
- Continuous improvement roadmap for Ansible adoption

© 0xfurai · MIT · 0xfurai/claude-code-subagents

Similar subagents

All subagents for DevOps and infrastructure →

From the same set137

The whole set →
github-actions-expert The github-actions-expert subagent helps build and debug GitHub Actions workflows, from YAML jobs and CI/CD pipelines to secrets, caching, and failed runs. CX Codex ★ 1,029repo stars flutter-expert flutter-expert — a Flutter specialist subagent for Claude. It handles widgets, state management, animations and API calls; the agent file goes into .claude/agents/. CX Codex ★ 1,029repo stars java-expert java-expert is a Claude Code subagent for writing and reviewing Java code. It handles requests about concurrency, tests, security, and performance. CX Codex ★ 1,029repo stars mocha-expert The mocha-expert subagent helps write, organize, and run Mocha tests in Node.js projects. Use it for async code, test hooks, coverage checks, and failure diagnosis. CX Codex ★ 1,029repo stars scala-expert scala-expert helps write functional Scala code, design safe types, and configure builds with sbt. Useful when refactoring legacy codebases and writing unit tests. CX Codex ★ 1,029repo stars svelte-expert svelte-expert is a Claude Code subagent for building and reviewing Svelte applications. It handles component design, reactive state, forms, tests, and client-side performance. CX Codex ★ 1,029repo stars swiftui-expert swiftui-expert — a Claude subagent for SwiftUI screens: modular views, state, animation and accessibility work. Useful once a screen grows and state starts leaking everywhere. CX Codex ★ 1,029repo stars react-native-expert react-native-expert guides React Native mobile development for iOS and Android, focusing on performance, native bridge integrations, and release pipelines. CX Codex ★ 1,029repo stars

Project sponsors

Companies that keep this analytics open