bedkillerspacex-boop/codex-skill-library/ansible-role-testing
Claude Code and agent skill by bedkillerspacex-boop/codex-skill-library
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Test Ansible roles with molecule/docker (or podman), idempotence, ansible-lint, and secret-safe fixtures for owned automation repos. Use when adding CI for roles, verifying converge/idempotence/verify, or preventing regressions before production apply.
Install
npx vskill@latest install bedkillerspacex-boop/codex-skill-library/ansible-role-testingSKILL.md
The same SKILL.md was published earlier as bedkillerspacex-boop/codex-skill-library/ansible-role-testing.
Ansible Role Testing
Scope And Authorization
- In scope: Ansible roles/collections in repos you own; molecule against disposable containers/VMs.
- Out of scope: Pointing molecule at production inventory; using real prod secrets in CI logs.
- Prefer containers for unit-like role tests; use staging for full integration.
- Pair with
ansible-vault-usageandcode-quality-standards.
When To Use
- Creating or refactoring an Ansible role.
- Adding GitHub Actions/GitLab CI for
molecule test/ansible-lint. - Proving idempotence (second converge changes 0).
- Catching template/handler regressions.
Do Not Use As Primary
| Need | Skill instead | |
|---|---|---|
| Vault encrypt/decrypt workflows | ansible-vault-usage | |
| Org secrets program | secrets-management-hygiene | |
| General Linux hardening content | linux hardening skills | |
| Implementation quality baseline | code-quality-standards |
Domain Focus
| Stage | Purpose | |
|---|---|---|
ansible-lint | Static best practices | |
molecule create | Spin test instance | |
converge | Apply role | |
idempotence | Re-apply; expect no changes | |
verify | Assert state (testinfra/goss) | |
destroy | Cleanup |
Workflow
1. Confirm role and success criteria
- Record role path, supported platforms (EL9, Ubuntu 22.04, …), required privileges.
- Success: lint clean; molecule test green on listed platforms; no secrets in repo; idempotent.
- List dependencies (roles/collections).
2. Scaffold molecule (if missing)
3. Write converge and verify
4. Secrets in tests
- Use dummy passwords in molecule fixtures — never prod vault files.
- If role requires vault, inject CI secret via env and
ANSIBLE_VAULT_PASSWORD_FILEpointing to temp file with mode 600. - Assert role fails closed when secrets missing if that is desired behavior.
5. Run locally and in CI
6. Multi-platform matrix
- Add platforms for each supported OS image.
- Skip tags with
molecule converge -- --skip-tags slowonly when documented. - Fail CI on any platform in the support matrix.
7. Hand off
- Document how to run molecule; required collections in
requirements.yml. - Badge/CI required on PRs touching role.
- Production apply still needs change window — tests reduce risk, not replace judgment.
Good / Bad
| Topic | Good | Bad | |
|---|---|---|---|
| Target | Ephemeral containers | Prod hosts as molecule driver | |
| Idempotence | Enforced in CI | “Run twice manually sometimes” | |
| Secrets | Dummy values | Real prod vault in git | |
| Verify | Assertions on state | Converge-only smoke |
Output Checklist
- [ ] Platforms and role path documented
- [ ] ansible-lint clean
- [ ] molecule scenario present
- [ ] converge + idempotence + verify green
- [ ] No real secrets in fixtures
- [ ] CI wired for PRs
- [ ] Collection deps pinned
- [ ]
code-quality-standardsapplied
Rules
- Owned automation only; never test against unapproved fleets.
- Prefer disposable infrastructure for molecule.
- Idempotence is part of the contract.
- Keep vault passwords out of logs.
- Lint + molecule before production apply.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingansible-role-testing/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/bedkillerspacex-boop/codex-skill-library/ansible-role-testing)