Ansible verification loop
Skill konstruktoid/agent-instructions-skills/skills/ansible/ansible-verification-loop
Reviews and modifies Ansible roles, collections, playbooks, and tasks, verified through the target repository's own lint/test loop rather than declaring success from the edit alone. Use when reviewing or modifying any Ansible role, collection, playbook, or task.From its SKILL.md
npx -y skills add konstruktoid/agent-instructions-skills --skill ansible-verification-loopAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
6.7 KB, ~1.5k tokens by cl100k_base, as published. Nobody here has run it
ansible-verification-loop
Purpose
Provide a structured approach for reviewing and modifying Ansible roles and collections. Ensures changes are made consistently with the target repo's own conventions, verified through a real lint/test loop, and reported clearly. It works across different repos' test setups (molecule, ansible-test, tox, pytest-ansible, etc.) by discovering what is actually there rather than assuming one project's layout.
When to use this
- Reviewing or modifying any Ansible role, collection, playbook, or task.
- You need to ensure changes are consistent with existing conventions and actually verified before being reported done.
When NOT to use this
- Changes that do not involve Ansible roles, collections, playbooks, or tasks.
Steps
- Orient in the target role/collection before changing anything:
- Read the relevant role's
defaults/main.yml,tasks/main.yml,meta/main.yml, and anyhandlers/,vars/,templates/it touches. - For collections, also check
galaxy.yml,meta/runtime.yml, andrequirements.ymlfor dependencies and supported Ansible/Python versions.
- Read the relevant role's
- Discover and follow the repo's own authoritative rules. Check for (roughly in priority order):
.github/copilot-instructions.md,.github/instructions/*.instructions.md,CONTRIBUTING.md,CLAUDE.md,AGENTS.md, or adocs/style guide. If none exist, infer conventions from surrounding code (FQCN vs short module names, quoting style, variable naming, indentation). Regardless of what a repo's docs say, treat SSH/sudo/PAM/audit/SELinux/AppArmor/firewall/ mounts/sysctl/services/auth-adjacent tasks as high-sensitivity. - Follow the existing conventions and patterns already in the codebase: naming, file structure, style.
- If OS-conditional logic changes, keep
meta/main.ymlgalaxy_info.platforms(role) or the collection's declared platform support in sync with it. - If default values, argument specs, or variable names change, update all relevant documentation
(README, role docs,
meta/argument_specs.yml, etc). - Add or update test coverage for the change. Discover how this repo actually tests roles before
assuming a layout. Common patterns, roughly in order of how likely you are to find them:
- Molecule scenarios per role (
roles/<name>/molecule/<scenario>/). - A shared/centralized molecule setup exercising multiple roles together (e.g. one
converge.ymlthat includes several roles plus per-roleverify_<role>.ymlfiles included from a sharedverify.yml). If you find this pattern, add/update the entries for the role you touched rather than creating a new scenario. ansible-test(collections): unit tests undertests/unit/, integration targets undertests/integration/targets/.- Plain
toxenvs wrapping any of the above. Checktox.inifor the actual env names before assuming whattox -e <name>runs. Match whatever pattern the repo already uses; do not introduce a new test framework alongside an existing one.
- Molecule scenarios per role (
- Verify the change (see checklist below) in a bounded loop. One attempt is one full
fix-and-rerun cycle: apply fixes for the findings from the previous run, then rerun the
verification commands to completion. Reading output or re-reading a file without changing
anything is not an attempt.
- Baseline the loop at 3 attempts.
- Continue past 3 only while making measurable progress, meaning each cycle ends with strictly fewer findings than the one before it.
- Stop early, before 3 attempts, if the loop is oscillating: the same findings recur, the count stops dropping, or a fix for one finding reintroduces another.
- When stopping for either reason, report to the user instead of proceeding or silently giving up. Name the failing check, include its output, and state what was tried.
- Report any issues found during verification, with detailed reproduction steps and relevant logs/output.
Verify
- Run
ansible-lint(or the repo's configured linter/config, e.g. a non-default.ansible-lintpath) and confirm a clean exit / expected output. This is the primary quality gate. Do not add suppressions to silence findings from new changes just to get a clean run. - Run the repo's full test entry point and confirm success. This is usually a
toxenv (checktox.ini/tox -avfor the right one, e.g.tox -e docker,tox -e molecule), a Makefile target, or a CI workflow file (.github/workflows/*.yml) that spells out the exact commands. It typically installs dependencies (requirements.yml/galaxy.yml), lints, then converges and verifies in containers/VMs across the platforms the role/collection claims to support, including an idempotence check. - If invoking
molecule test/ansible-testdirectly instead of through the repo's wrapper, do first what the wrapper would have done for you: installrequirements.yml, and always runansible-lintas its own separate step. Molecule's ownlintsubcommand was removed in Molecule 6.x and has not returned, so no version of a directmolecule test/molecule convergeinvocation lints for you; skipping the separateansible-lintrun silently drops the primary quality gate. - While iterating on a single role, use
molecule converge/molecule verify(or the equivalent faster subcommands for whatever framework is in use) instead of the full test cycle to save time, but always finish with a full test run before declaring the change verified.
Verification checklist
Never declare this done based on the edit alone. Confirm each of the following:
- Verify loop run to a clean result, or stopped under the rules in step 7 with unresolved issues reported, naming the failing check and its output
- Lint passes
- Full test suite passes
- Idempotence holds (no changes reported on a second converge/apply)
- Test fixtures (verify files, converge vars, integration targets) updated if behavior or variables changed
- Platform/version support declarations (
meta/main.yml,galaxy.yml) still match any OS-conditional logic - No unrelated files changed
References
- references/yaml-quoting.md: YAML 1.2.2 scalar resolution and quoting, including the "Norway problem". Read it when a change touches quoting in a YAML file, or when justifying why a value must stay quoted.
What ships with it: 1 file
1.9 KB alongside SKILL.md
references/
- yaml-quoting.md1.9 KB