agentleFS
XData-siXData-si/xdata-agenthub/skills/ansible-review/SKILL.md

ansible-review

Skill1 starsChanged 35 days agoMITView on GitHub

Review Ansible playbooks and roles for idempotency, safety and secret handling — check mode and diff, privilege escalation, module choice over shell commands, Ansible Vault, inventory hygiene and testing with Molecule. Use when writing or reviewing configuration management code or before running playbooks against production hosts.

  • Installs packages

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never run untested playbooks against production.

    line 42

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Ansible Review

Goal

Playbooks that converge to the same state on every run, show their changes before applying them, keep secrets encrypted and can be tested without touching production.

Inputs

  • Playbooks, roles, inventories per environment, variables and vault files, Ansible and collection versions, target operating systems.

Review checklist

  1. Idempotency: modules (ansible.builtin.package, template, lineinfile, systemd) instead of shell/command; where commands are unavoidable, use creates, removes or changed_when; a second run reports zero changes.
  2. Check and diff: tasks support --check --diff; the run against production is preceded by a check-mode run that a human reviews.
  3. Privilege: become only where needed, not globally; no running as root by default; sudo rules for automation users scoped.
  4. Secrets: Ansible Vault or an external secret lookup; no_log: true on tasks handling secrets; no secrets in inventory files or command lines.
  5. Inventory: environments separated (no shared inventory that mixes staging and production); host patterns explicit; --limit used for staged rollouts.
  6. Safety controls: serial for rolling changes, max_fail_percentage, handlers for restarts, pre-checks (disk, connectivity) and post-checks (service health).
  7. Code quality: ansible-lint clean, fully qualified collection names, pinned collection versions (requirements.yml), role defaults documented.
  8. Testing: Molecule scenarios on containers or VMs for each role, including an idempotency step.

Example fixture

- name: install nginx
  shell: apt-get install -y nginx && echo "password=S3cret" > /etc/app.conf
  become: yes

Expected findings: shell instead of the package module (not idempotent, no check mode), secret written in plain text in the playbook and logs.

Acceptance checks

  • ansible-lint passes; Molecule converge plus idempotence step shows zero changes on the second run.
  • Negative case: running with --check --diff against a test host changes nothing on it.
  • Production runs follow a reviewed check-mode diff and use serial with health checks.

Output

Findings, revised tasks or roles, Molecule scenarios, run plan for production.

Safety

Never run untested playbooks against production. Production runs require approval, a reviewed diff and a limited first batch.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.