ansible-automation — Claude Code skill: playbooks, roles, inventory
An Ansible skill for your coding agent: write playbooks, roles and inventory, deploy apps and patch servers.
npx skills add aj-geddes/useful-ai-prompts --skill ansible-automation -a claude-codeWhat ansible-automation does
The skill teaches the agent how Ansible work is structured: playbooks, roles, inventory and variables. It ships a minimal site.yml example with common, docker and application roles plus a health check through the uri module, and four reference guides under references/ covering playbook structure, inventory and variables, a deployment script and a configuration template.
Use it when you need to roll an app out across several servers, patch a fleet, or move config into templates. The best-practices section is blunt about what breaks things: run check mode first, keep environments out of the same inventory, stop hardcoding values, and don't reach for command or shell when a module does the job. Secrets belong in vault, inventory belongs in version control.
Install runs through npx skills add, or gh skill install for GitHub Copilot. There are no API keys or extra dependencies to wire up — it is a set of instructions and reference files, and Ansible itself still has to be on the machine.
What it helps with
- split a monolithic playbook into reusable roles
- patch a fleet of servers without taking them all down
- move config into templates and drop hardcoded values
- dry-run changes in check mode before touching production
- keep secrets in vault and inventory in git
Example prompts for the agent
- write a playbook that deploys the app to a server group using roles
- review my site.yml against the best practices in this skill
- create a config template and wire it up with handlers
How to install ansible-automation
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill ansible-automation -a claude-code2Manually: put the files in place
~/.claude/skills/ansible-automation/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/ansible-automation/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill ansible-automation -a codex2Manually: put the files in place
.agents/skills/ansible-automation/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill ansible-automation -a cursor2Manually: put the files in place
.cursor/skills/ansible-automation/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts ansible-automation2Manually: put the files in place
.github/skills/ansible-automation/SKILL.md1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill ansible-automation -a gemini-cli2Platform CLI
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/ansible-automationManually: put the files in place
.devin/skills/ansible-automation/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill ansible-automation -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about ansible-automation
How do I install ansible-automation in Claude?
Run npx skills add aj-geddes/useful-ai-prompts --skill ansible-automation -a claude-code. The skill lands in ~/.claude/skills/ansible-automation/SKILL.md.
What does ansible-automation do?
It gives the agent Ansible patterns for playbooks, roles and inventory: app deployment, patching, server management. It leans on a starter example and four guides in references/.
Do I need Ansible installed?
The skill is instructions and reference files, with no dependencies of its own. Ansible itself has to be installed separately to run the playbooks.
Source text
SKILL.md · MIT
---
name: ansible-automation
description: >
Infrastructure automation and configuration management using Ansible
playbooks, roles, and inventory. Use for deploying applications, patching, and
managing servers.
---
# Ansible Automation
## Table of Contents
- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)
## Overview
Automate infrastructure provisioning, configuration management, and application deployment across multiple servers using Ansible playbooks, roles, and dynamic inventory management.
## When to Use
- Configuration management
- Application deployment
- Infrastructure patching and updates
- Multi-server orchestration
- Cloud instance provisioning
- Container management
- Database administration
- Security compliance automation
## Quick Start
Minimal working example:
```yaml
# site.yml - Main playbook
---
- name: Deploy application stack
hosts: all
gather_facts: yes
serial: 1 # Rolling deployment
pre_tasks:
- name: Display host information
debug:
var: inventory_hostname
tags: [always]
roles:
- common
- docker
- application
post_tasks:
- name: Verify deployment
uri:
url: "http://{{ inventory_hostname }}:8080/health"
status_code: 200
retries: 3
delay: 10
// ... (see reference guides for full implementation)
```
## Reference Guides
Detailed implementations in the `references/` directory:
| Guide | Contents |
|---|---|
| [Playbook Structure and Best Practices](references/playbook-structure-and-best-practices.md) | Playbook Structure and Best Practices |
| [Inventory and Variables](references/inventory-and-variables.md) | Inventory and Variables |
| [Ansible Deployment Script](references/ansible-deployment-script.md) | Ansible Deployment Script |
| [Configuration Template](references/configuration-template.md) | Configuration Template |
## Best Practices
### ✅ DO
- Use roles for modularity
- Implement proper error handling
- Use templates for configuration
- Leverage handlers for idempotency
- Use serial deployment for rolling updates
- Implement health checks
- Store inventory in version control
- Use vault for sensitive data
### ❌ DON'T
- Use command/shell without conditionals
- Copy files without templates
- Run without check mode first
- Mix environments in inventory
- Hardcode values
- Ignore error handling
- Use shell for simple tasks
© aj-geddes · MIT · aj-geddes/useful-ai-prompts