ansible-playbooks
Use when writing and organizing Ansible playbooks for automated configuration management and infrastructure orchestration.
Best use case
ansible-playbooks is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when writing and organizing Ansible playbooks for automated configuration management and infrastructure orchestration.
Teams using ansible-playbooks should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/ansible-playbooks/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How ansible-playbooks Compares
| Feature / Agent | ansible-playbooks | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when writing and organizing Ansible playbooks for automated configuration management and infrastructure orchestration.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Ansible Playbooks
Writing and organizing Ansible playbooks for configuration management.
## Basic Playbook
```yaml
---
- name: Configure web servers
hosts: webservers
become: yes
vars:
http_port: 80
app_version: "1.0.0"
tasks:
- name: Install nginx
apt:
name: nginx
state: present
update_cache: yes
- name: Start nginx
service:
name: nginx
state: started
enabled: yes
- name: Deploy application
copy:
src: ./app
dest: /var/www/html
owner: www-data
mode: '0755'
```
## Inventory
```ini
[webservers]
web1.example.com
web2.example.com
[databases]
db1.example.com
[production:children]
webservers
databases
```
## Common Modules
### Package Management
```yaml
- name: Install packages
apt:
name:
- nginx
- git
- python3
state: present
```
### File Operations
```yaml
- name: Copy configuration
template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
backup: yes
notify: Restart nginx
```
### Handlers
```yaml
handlers:
- name: Restart nginx
service:
name: nginx
state: restarted
```
## Best Practices
### Use Roles
```
roles/
├── webserver/
│ ├── tasks/
│ │ └── main.yml
│ ├── handlers/
│ │ └── main.yml
│ └── templates/
│ └── nginx.conf.j2
```
### Idempotency
```yaml
- name: Ensure directory exists
file:
path: /opt/app
state: directory
mode: '0755'
```Related Skills
ansible
Provides comprehensive guidance for Ansible automation including playbooks, roles, inventory, and module usage. Use when the user asks about Ansible, needs to automate IT tasks, create Ansible playbooks, or manage infrastructure with Ansible.
ansible-workflow
Ansible automation workflow guidelines. Activate when working with Ansible playbooks, ansible-playbook, inventory files (.yml, .ini), or Ansible-specific patterns.
ansible-validator
Comprehensive toolkit for validating, linting, testing, and automating Ansible playbooks, roles, and collections. Use this skill when working with Ansible files (.yml, .yaml playbooks, roles, inventories), validating automation code, debugging playbook execution, performing dry-run testing with check mode, or working with custom modules and collections.
ansible-testinfra
Bootstrap minimal testinfra pytest suite for an Ansible role and remind to run via uv
ansible-roles
Use when structuring and reusing code with Ansible roles for modular, maintainable automation and configuration management.
ansible-role-init
Scaffold a new Ansible role via ansible-galaxy init
ansible-playbook
Write and review Ansible playbooks following best practices. Use when the user says "write ansible", "ansible playbook", "review playbook", "automate with ansible", or asks to configure servers with Ansible.
ansible-inventory
Use when managing hosts and groups in Ansible inventory for organizing infrastructure and applying configurations across environments.
ansible-host-limiter
Ensures ansible and ansible-playbook commands always include the -l (limit) flag to target only ndelucca-server and prevent accidental execution on raspberry-printer or other hosts. Activate this skill whenever running any ansible or ansible-playbook commands.
ansible-fix
ALWAYS use this skill immediately after running 'ansible-galaxy init' to create a new Ansible role. Also use when the user asks to fix ansible-lint errors or when ansible-lint output shows fixable issues like yaml[comments], schema[meta], meta-incorrect, name[play], or role-name[path] violations.
ansible-expert
Expert-level Ansible for configuration management, automation, and infrastructure as code
ansible-dev-setup
Generate and manage cross-platform Ansible playbooks for development environment setup across macOS, Linux, and Termux. Use when working with development environment automation, package installation configuration, or Ansible playbook generation.