Automated summary
Writes and reviews Ansible playbooks, roles, and tasks following best practices such as FQCNs, idempotency, handlers, and secret handling.
Strengths
- Enforces concrete, checkable conventions: fully qualified collection names, a name on every task, explicit become
- Ships reusable patterns for templated configs with validate, service restart handlers, and package installation
- Includes a security checklist covering vault-encrypted secrets, no_log on sensitive tasks, and explicit file permissions
Limitations
- Only relies on the generic modules shown (apt, service, template); no distro-specific or third-party collection guidance
- Focused on authoring and static review, with no actual run or --check verification
- No automated testing strategy (molecule, lint) beyond a note about check-mode compatibility
When you need to author or audit an Ansible playbook that configures servers idempotently and securely.
When the task is cloud resource provisioning or Terraform/Kubernetes orchestration rather than Ansible configuration.
Security analysis
CautionThe content is a conventional Ansible style guide: it teaches FQCN usage, idempotency, handlers, vault for secrets, and explicitly forbids hardcoded secrets and unnecessary shell tasks. There is nothing destructive, obfuscated, or exfiltrating (no curl|sh, rm -rf, or secret transmission). The only reason it is not 'safe' is the broad allowed-tools set (Bash/Write/Edit), which is powerful but entirely appropriate for writing and validating playbooks.
- •Declares Bash and Write/Edit access, which lets the agent execute commands and modify files on the host
- •No explicit guardrails limiting Bash usage to check-mode/lint/read-only Ansible invocations
Examples
Write an Ansible playbook that installs nginx and certbot on our webservers, deploys a config template, and restarts nginx only when the config changes.Review roles/app/tasks/main.yml and flag anything that breaks our Ansible best practices — missing FQCNs, hardcoded secrets, non-idempotent shell commands.Refactor this playbook so the database password comes from an ansible-vault file and the task that writes it uses no_log.name: ansible-playbook description: 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. allowed-tools: Read, Write, Edit, Glob, Grep, Bash
Ansible Playbook
Write and review Ansible playbooks, roles, and tasks following best practices.
Instructions
When writing:
- Understand the target configuration goal
- Check existing playbooks/roles for patterns to follow
- Write idempotent tasks with proper error handling
- Include appropriate tags and handlers
When reviewing:
- Read the playbook/role
- Check for issues listed below
- Suggest improvements
Playbook structure
---
- name: Configure web servers
hosts: webservers
become: true
vars_files:
- vars/main.yml
handlers:
- name: Restart nginx
ansible.builtin.service:
name: nginx
state: restarted
tasks:
- name: Install nginx
ansible.builtin.apt:
name: nginx
state: present
update_cache: true
notify: Restart nginx
tags: [nginx, packages]
Best practices
- MUST use FQCNs:
ansible.builtin.copynotcopy - MUST use
name:for every task - MUST use
become:explicitly, not assuming root - Use handlers for service restarts
- Use
block/rescue/alwaysfor error handling - Use
ansible-vaultfor secrets - Use variables for anything environment-specific
- Use
--checkmode compatible tasks where possible
Security checks
- No plaintext passwords in playbooks
- Secrets in vault-encrypted files
no_log: trueon tasks with sensitive data- File permissions explicitly set
- SSH keys not hardcoded
Common patterns
# Idempotent file content
- name: Configure app
ansible.builtin.template:
src: app.conf.j2
dest: /etc/app/config
mode: "0644"
owner: app
group: app
validate: "/usr/bin/app --check %s"
notify: Restart app
# Package installation
- name: Install packages
ansible.builtin.apt:
name: "{{ packages }}"
state: present
vars:
packages:
- nginx
- certbot
Rules
- MUST use fully qualified collection names (FQCNs)
- MUST include task names
- Never hardcode secrets in playbooks
- Never use
shell:when a module exists - Always make tasks idempotent
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/ansible-playbook-writing-and-review-mm78nocd/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/ansible-playbook-writing-and-review-mm78nocd' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/ansible-playbook-writing-and-review-mm78nocd/download' --output '.skill-downloads/ansible-playbook-writing-and-review-mm78nocd/SKILL.md.part' && mv '.skill-downloads/ansible-playbook-writing-and-review-mm78nocd/SKILL.md.part' '.skill-downloads/ansible-playbook-writing-and-review-mm78nocd/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
Tools declared by the author (check availability in your agent): Read, Write, Edit, Glob, Grep, Bash
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/ansible-playbook-writing-and-review-mm78nocd/SKILL.md' && test -s '.skill-downloads/ansible-playbook-writing-and-review-mm78nocd/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/ansible-playbook' && cp -R '.skill-downloads/ansible-playbook-writing-and-review-mm78nocd' '.claude/skills/ansible-playbook'Cursor
test -f '.skill-downloads/ansible-playbook-writing-and-review-mm78nocd/SKILL.md' && test -s '.skill-downloads/ansible-playbook-writing-and-review-mm78nocd/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/ansible-playbook' && cp -R '.skill-downloads/ansible-playbook-writing-and-review-mm78nocd' '.cursor/skills/ansible-playbook'Codex
test -f '.skill-downloads/ansible-playbook-writing-and-review-mm78nocd/SKILL.md' && test -s '.skill-downloads/ansible-playbook-writing-and-review-mm78nocd/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/ansible-playbook' && cp -R '.skill-downloads/ansible-playbook-writing-and-review-mm78nocd' '.agents/skills/ansible-playbook'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/ansible-playbook-writing-and-review-mm78nocd'openskills read 'ansible-playbook-writing-and-review-mm78nocd'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/ansible-playbook-writing-and-review-mm78nocd/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
Configure a Chat Channel with SecretRefs
DevOps
Set up chat channels using non-interactive commands, with secrets only as SecretRefs. Covers gather, mutate, repair, and prove steps for reliable delivery.
Investigate ClickHouse CI Failures
DevOps
Investigate a ClickHouse CI failure end-to-end from a PR or S3 report URL. Fetches failed tests, classifies flaky vs real regression, and checks for existing issues/fixes.
Ansible PR Review
DevOps
Reviews an Ansible PR following the project's standardized process, including changelog checks, test coverage validation, and feedback tracking.