ansible-expert — субагент для Claude Code: плейбуки и роли Ansible
Субагент ansible-expert для Claude Code пишет и разбирает плейбуки Ansible: роли, инвентарь и Vault. Помогает описывать инфраструктуру кодом.
MIT ★ 1 029 обновлён 2025-10-15
.claude/agents/ansible-expert.mdЧто делает ansible-expert
Субагент ansible-expert в Claude берётся за конфигурацию хостов, деплой приложений и оркестрацию задач: собирает плейбуки, разносит их по ролям, подключает динамический инвентарь и шаблоны Jinja2. Зовёте его, когда нужно поправить Ansible-код — ответ приходит в терминах модулей и ролей.
Внутри — набор разделов: зоны ответственности, подход, чек-лист качества и то, что субагент отдаёт на выходе. Подход задаёт порядок работы: сначала инвентарь и группировка хостов, затем модульные роли, переменные и факты вместо хардкода. Для секретов предусмотрен Ansible Vault, а плейбук сначала идёт в staging, потом в продакшен.
Отсюда главное ограничение: если у вас принято гонять плейбуки сразу на живых хостах, этот порядок придётся поменять. Зато идемпотентность стоит первым пунктом чек-листа, и задачу, которая меняет состояние при повторном прогоне, субагент назовёт сразу.
Какие задачи решает
- собрать роль из разросшегося плейбука
- перевести пароли в Ansible Vault
- настроить динамический инвентарь для меняющегося парка хостов
- добиться идемпотентности повторных прогонов
- встроить прогон плейбуков в CI/CD
Примеры запросов агенту
- Разбей этот плейбук на роли и убери дублирование между задачами.
- Проверь мой плейбук на идемпотентность: где повторный прогон меняет состояние?
- Перенеси пароли в Ansible Vault и поправь задачи, которые их читают.
Как установить ansible-expert
Вручную: положить файлы
.claude/agents/ansible-expert.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию
Вручную: положить файлы
.codex/agents/ansible-expert.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/ansible-expert.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы об ansible-expert
Как установить ansible-expert в Claude Code?
Положите файл субагента в проект по пути .claude/agents/ansible-expert.md. Других шагов нет: дальше вы просто зовёте его по имени.
Что делает ansible-expert?
Пишет и переделывает плейбуки Ansible: раскладывает задачи по ролям, настраивает инвентарь, подключает Jinja2-шаблоны и следит за идемпотентностью прогонов.
Куда он прячет секреты?
В Ansible Vault. Шифрование учётных данных заявлено отдельным пунктом в его зонах ответственности и в чек-листе качества.
Исходный текст
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