/ansible-skills:ansible-playbookfrom ansible-skills
Creates and debugs Ansible playbooks, roles, and inventory files. Automates infrastructure with idempotent tasks, YAML syntax checks, module troubleshooting, and variable precedence resolution.
Ships in ansible-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Ansible playbooks declare desired system state rather than imperative commands. The core principle is idempotency: running a playbook multiple times produces the same result without unintended changes.
project/
├── ansible.cfg # Configuration
├── inventory # Host definitions
├── group_vars/ # Group variables
├── host_vars/ # Host-specific vars
├── roles/ # Reusable roles
└── playbooks/ # Playbook files
[defaults]
inventory = ./inventory
roles_path = ./roles
host_key_checking = False
stdout_callback = yaml
[privilege_escalation]
become = True
become_method = sudo
| Operation | Module | Key Parameters |
|---|---|---|
| Create directory | ansible.builtin.file | state: directory, mode, owner |
| Copy file | ansible.builtin.copy | src, dest, mode |
| Template | ansible.builtin.template | src, dest, variables in .j2 |
| Install package | ansible.builtin.package | name, state: present |
| Manage service | ansible.builtin.service | name, state, enabled |
| Run command | ansible.builtin.command | cmd, register result, set changed_when |
defaults/main.yml)vars/main.yml)-e)tasks:
- name: Update config
ansible.builtin.template:
src: app.conf.j2
dest: /etc/app.conf
notify: Restart app
handlers:
- name: Restart app
ansible.builtin.service:
name: app
state: restarted
- block:
- name: Risky operation
ansible.builtin.command: /opt/app/upgrade.sh
rescue:
- name: Handle failure
ansible.builtin.debug:
msg: "Upgrade failed, rolling back"
always:
- name: Cleanup
ansible.builtin.file:
path: /tmp/upgrade.lock
state: absent
| Mistake | Fix |
|---|---|
| Using short module names | Always use FQCN: ansible.builtin.copy not copy |
| Hardcoded values | Extract to variables in defaults/main.yml |
Missing changed_when on commands | Add changed_when: "'created' in result.stdout" |
| Forgetting handler flush | Use meta: flush_handlers when needed before dependent tasks |
| YAML indentation errors | Use 2 spaces, never tabs |
| Colon in unquoted string | Quote values containing : |
ansible-playbook --syntax-check playbook.yml # Check YAML
ansible-playbook --check playbook.yml # Dry run
ansible-playbook --check --diff playbook.yml # Show file changes
ansible-inventory --list # Verify inventory
ansible-inventory --host hostname # Check host vars
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub realsigridjin/hello-ansible-skills --plugin ansible-skills4 skills in this plugin
/ansible-convertUse when converting shell scripts to Ansible playbooks. Use when migrating bash automation, manual procedures, or Dockerfiles to idempotent Ansible tasks./ansible-debugUse when playbooks fail with UNREACHABLE, permission denied, MODULE FAILURE, or undefined variable errors. Use when SSH connections fail or sudo password is missing./ansible-interactiveUse when guiding someone through Ansible setup step-by-step. Use when starting a new Ansible project from scratch. Use when teaching Ansible through hands-on development.2 plugins ship this exact skill · first indexed Jul 21, 2026
Other plugins' skills for the same job