Ansible playbook creator for configuration management and server automation
Ships in devops. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Ansible playbook creator for configuration management and server automation.
Use this skill when:
# site.yml
---
- name: Configure web servers
hosts: webservers
become: yes
vars:
app_user: webapp
app_port: 8080
tasks:
- name: Install dependencies
apt:
name:
- nginx
- python3-pip
state: present
update_cache: yes
- name: Create application user
user:
name: "{{ app_user }}"
shell: /bin/bash
home: "/home/{{ app_user }}"
- name: Deploy application
copy:
src: /app/dist/
dest: /var/www/html/
owner: "{{ app_user }}"
mode: '0644'
- name: Start nginx service
service:
name: nginx
state: started
enabled: yes
handlers:
- name: Reload nginx
service:
name: nginx
state: reloaded
# inventory.ini
[webservers]
web1.example.com ansible_user=ubuntu
web2.example.com ansible_user=ubuntu
[databases]
db1.example.com ansible_user=ubuntu
db2.example.com ansible_user=ubuntu
[all:vars]
ansible_python_interpreter=/usr/bin/python3
# inventory.yml
all:
vars:
ansible_python_interpreter: /usr/bin/python3
hosts:
web1.example.com:
ansible_user: ubuntu
web2.example.com:
ansible_user: ubuntu
children:
webservers:
hosts:
web1.example.com:
web2.example.com:
databases:
hosts:
db1.example.com:
db2.example.com:
# aws.yml
plugin: aws_ec2
regions:
- us-east-1
keyed_groups:
- key: tags.Environment
prefix: env_
- key: tags.Role
prefix: role_
filters:
instance-state-name: running
- name: Install packages
apt:
name: "{{ item }}"
state: present
loop:
- nginx
- git
- python3-pip
- name: Remove packages
apt:
name: "{{ item }}"
state: absent
loop:
- apache2
- old-package
- name: Create user with SSH key
user:
name: deploy
shell: /bin/bash
groups: sudo
append: yes
ssh_key_file: ~/.ssh/id_rsa.pub
- name: Ensure user has authorized_keys
authorized_key:
user: deploy
key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
- name: Copy configuration file
copy:
src: config/nginx.conf
dest: /etc/nginx/nginx.conf
owner: root
group: root
mode: '0644'
backup: yes
notify: Reload nginx
- name: Create directory with permissions
file:
path: /var/log/app
state: directory
owner: app
group: app
mode: '0755'
- name: Template configuration
template:
src: templates/app.conf.j2
dest: /etc/app/app.conf
owner: root
mode: '0644'
- name: Ensure service is running
service:
name: nginx
state: started
enabled: yes
- name: Restart service
service:
name: nginx
state: restarted
- name: Stop service
service:
name: apache2
state: stopped
enabled: no
- name: Install PostgreSQL
apt:
name: postgresql
state: present
- name: Start PostgreSQL
service:
name: postgresql
state: started
enabled: yes
- name: Create database
postgresql_db:
name: appdb
owner: appuser
- name: Create database user
postgresql_user:
db: appdb
name: appuser
password: "{{ db_password }}"
priv: "ALL"
handlers:
- name: Reload nginx
service:
name: nginx
state: reloaded
- name: Restart application
systemd:
name: app
state: restarted
tasks:
- name: Update configuration
template:
src: app.conf.j2
dest: /etc/app/app.conf
notify: Restart application
- name: Install package (Debian)
apt:
name: nginx
state: present
when: ansible_os_family == "Debian"
- name: Install package (RedHat)
yum:
name: nginx
state: present
when: ansible_os_family == "RedHat"
- name: Run task if variable is defined
debug:
msg: "Variable is set"
when: my_var is defined
- name: Create multiple users
user:
name: "{{ item.name }}"
groups: "{{ item.groups }}"
loop:
- { name: alice, groups: developers }
- { name: bob, groups: developers }
- { name: charlie, groups: admins }
- name: Install packages from list
apt:
name: "{{ item }}"
state: present
loop:
- nginx
- python3-pip
- git
# vars.yml
app_name: myapp
app_version: "1.0.0"
app_port: 8080
env_vars:
NODE_ENV: production
PORT: "{{ app_port }}"
DATABASE_URL: postgresql://localhost/app
# Use in playbook
- name: Set environment variables
copy:
dest: /etc/environment
content: |
{% for key, value in env_vars.items() %}
{{ key }}={{ value }}
{% endfor %}
# roles/nginx/tasks/main.yml
---
- name: Install nginx
apt:
name: nginx
state: present
- name: Configure nginx
template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
notify: Reload nginx
- name: Start nginx
service:
name: nginx
state: started
enabled: yes
# roles/nginx/handlers/main.yml
---
- name: Reload nginx
service:
name: nginx
state: reloaded
# Use role in playbook
- name: Configure web server
hosts: webservers
roles:
- nginx
# templates/nginx.conf.j2
server {
listen {{ app_port }};
server_name {{ server_name }};
location / {
root {{ app_root }};
index index.html;
}
{% if enable_ssl %}
listen 443 ssl;
ssl_certificate /etc/ssl/certs/{{ ssl_cert }};
ssl_certificate_key /etc/ssl/private/{{ ssl_key }};
{% endif %}
}
- name: Deploy to staging
hosts: staging
roles:
- app-deploy
tags: staging
- name: Deploy to production
hosts: production
roles:
- app-deploy
tags: production
- name: Rolling update
hosts: webservers
serial: 1
become: yes
tasks:
- name: Stop service
service:
name: app
state: stopped
- name: Deploy new version
copy:
src: app/
dest: /opt/app/
notify: Start service
# Encrypt variable file
ansible-vault encrypt secrets.yml
# Edit encrypted file
ansible-vault edit secrets.yml
# Use with playbook
ansible-playbook site.yml --ask-vault-pass
- name: Task with error handling
block:
- name: Potentially failing task
command: /bin/false
rescue:
- name: Handle error
debug:
msg: "Task failed, but playbook continues"
always:
- name: Always run
debug:
msg: "This runs regardless of success or failure"
Look for:
**/*.yml**/*.yaml**/roles/**/***/inventory/**/***/group_vars/**/***/host_vars/**/***/playbooks/**/*Ansible, configuration management, automation, playbook, inventory, role, deployment, server automation, idempotency, SSH, Jinja2, template, handler, variable, vault
What SKILL.md sets; muted values are Claude Code's defaults
/devops:ansible-playbook-creatorfrom devops
npx claudepluginhub dxta/claude-code-skills --plugin devops5 skills in this plugin
/ci-cd-pipeline-builderCI/CD pipeline builder for GitHub Actions, GitLab CI, and Jenkins/cloud-cost-optimizerCloud cost optimization and reporting for AWS, GCP, Azure - identify waste, rightsizing recommendations, reserved instance analysis, and cost allocation/github-actTest GitHub Actions locally with nektos/act through the GitHub CLI extension `gh act`. Use when running, debugging, listing, or simulating GitHub Actions workflows on a local machine; when a user mentions `gh act`, nektos/act, local Actions testing, `.actrc`, event payloads, workflow_dispatch inputs, local CI reproduction, GitHub Enterprise/GHE remotes such as `*.ghe`, or testing `.github/workflows/*.yml` before pushing. Proactively detect repo remote host and add `--github-instance` when origin uses a `*.ghe` domain.Other plugins' skills for the same job