/major-ai-skills:ansiblefrom major-ai-skills
Write idempotent Ansible playbooks, FQCN modules, roles, and inventories; gate prod with check/diff, pin collections, and keep ansible-vault secrets out of Git and chat.
Ships in major-ai-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.
Read when SKILL.md points to them.
Ansible pushes desired state to hosts (SSH, WinRM, or cloud APIs) via playbooks and roles. Controllers assemble inventory + vars, then run modules that converge without requiring agents on targets. Production quality means idempotent modules (not raw shell), FQCN (ansible.builtin.*), pinned collections, and vaulted secrets. Treat --check --diff as a pre-flight gate; never invent vault passwords or cloud credentials.
┌─────────────────────────────────────────────────────────────┐
│ Ansible control → managed nodes │
│ │
│ Inventory (static / dynamic) + group_vars / host_vars │
│ ├── Environment split: inventories/{dev,staging,prod} │
│ └── Vaulted secrets (never plaintext in Git) │
│ │
│ Playbook → roles (tasks / handlers / templates / defaults) │
│ ├── Modules (FQCN) > command/shell │
│ ├── Handlers fire only on changed │
│ └── serial / max_fail_percentage for rolling risk │
│ │
│ Targets: Linux SSH | Windows WinRM | cloud modules │
│ Optional: AWX / Execution Environments for fleet scale │
└─────────────────────────────────────────────────────────────┘
Use when
@terraform provisions hosts.--check --diff.Do not use when
@kubernetes / @helm.@docker (Ansible may only provision the host).group_vars secrets → refuse; use vault + CI secret mounts.ansible.builtin.package, copy, template, service, user, lineinfile. Use command/shell only when no module exists—and add creates/removes or honest changed_when.ansible.builtin.template) so collection resolution is explicit and lintable.notify only on real changed; never restart on every run via always-changed shell.ansible-playbook -i inventories/prod site.yml --check --diff (limit one host when diffs are large) before live apply.requirements.yml with versions; install via ansible-galaxy collection install -r requirements.yml.--limit at prod without explicit user confirmation.group_vars/*/vault.yml; never put vault passwords in the repo, chat, or playbook defaults.serial and max_fail_percentage on fleet-wide service flips.inventories/prod/hosts.yml:
all:
children:
web:
hosts:
web-01.example.com:
web-02.example.com:
vars:
ansible_user: deploy
ansible_become: true
requirements.yml:
---
collections:
- name: community.general
version: ">=8.0.0,<10.0.0"
- name: ansible.posix
version: ">=1.5.0,<2.0.0"
site.yml:
---
- name: Configure web hosts
hosts: web
become: true
serial: 1
max_fail_percentage: 25
roles:
- role: common
- role: nginx
vars:
nginx_worker_processes: auto
roles/nginx/tasks/main.yml:
---
- name: Ensure nginx is installed
ansible.builtin.package:
name: nginx
state: present
- name: Deploy nginx site config
ansible.builtin.template:
src: site.conf.j2
dest: /etc/nginx/sites-available/app.conf
mode: "0644"
notify: Reload nginx
- name: Enable site
ansible.builtin.file:
src: /etc/nginx/sites-available/app.conf
dest: /etc/nginx/sites-enabled/app.conf
state: link
notify: Reload nginx
# Last resort when no module exists — make reporting honest
- name: Probe nginx config (read-only)
ansible.builtin.command: nginx -t
register: nginx_test
changed_when: false
failed_when: nginx_test.rc != 0
roles/nginx/handlers/main.yml:
---
- name: Reload nginx
ansible.builtin.service:
name: nginx
state: reloaded
Validation loop:
ansible-galaxy collection install -r requirements.yml
ansible-inventory -i inventories/prod --list
ansible-playbook -i inventories/prod site.yml --syntax-check
ansible-playbook -i inventories/prod site.yml --check --diff --limit web-01.example.com
ansible-vault encrypt group_vars/prod/vault.yml # once; password via --vault-password-file (gitignored)
ansible-playbook -i inventories/prod site.yml --ask-vault-pass
| Signature | Likely cause | Fix path |
|---|---|---|
UNREACHABLE! / SSH timeout | Key, bastion, or ProxyJump missing | -vvv; fix ansible_ssh_common_args / inventory vars |
changed= on every run | shell/command without changed_when/creates | Switch to module or add honest idempotency guards |
| Handler restarts every run | Probe task reports changed | changed_when: false on read-only tasks |
| Template wrong / empty | Undefined var or wrong host/group_vars | ansible-inventory --host H; add defaults/main.yml |
| Check mode misses later tasks | Conditionals depend on registered live results | Document check-mode limits; use check_mode: false only when justified |
| Vault decrypt fail | Wrong password / vault-id | Confirm --vault-id and encrypted file set |
| Module not found | Collection not installed / unpinned | ansible-galaxy collection install -r requirements.yml |
| Partial fleet outage after apply | No serial / fail budget | Add serial + max_fail_percentage; tag rollback tasks |
--tags) for incident partial runs.{{ vault_db_password }}—never literal credentials in examples.@terraform (provision) then Ansible (configure); avoid duplicating cloud resource creation in both.ansible-lint; treat no-changed-when failures as real bugs.become and network access (bastion) in the role README.ansible.windows, vendor collections).--limit scope is unclear.@terraform — provision machines Ansible configures@docker — when config moves into images; Ansible only hardens the host@kubernetes / @helm — cluster-native config instead of SSH fleets@vault — dynamic secrets beyond static ansible-vault files@argocd / @fluxcd — GitOps for K8s (complement, not replace, VM Ansible)MANDATORY: Prefer FQCN modules over shell; make any unavoidable
command/shellidempotent withcreates/changed_when. Gate production with--check --diff. Pin collections inrequirements.yml. Never commit vault passwords or plaintext secrets; never invent credentials. Confirm inventory and--limitbefore touching prod.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization.Other plugins' skills for the same job
/act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.