Wdio Testing
ansible/vscode-ansible
Write, run, and debug WebDriverIO (WDIO) UI tests for the Ansible VS Code extension.
Validate, lint, audit, or debug Ansible playbooks, roles, inventories, FQCN, tasks.
$ npx skills add akin-ozer/cc-devops-skills --skill ansible-validator -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install akin-ozer/cc-devops-skills ansible-validator --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/akin-ozer/cc-devops-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/devops-skills-plugin/skills/ansible-validator .claude/skills/ansible-validator && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "ansible-validator" agent skill from https://github.com/akin-ozer/cc-devops-skills/tree/main/devops-skills-plugin/skills/ansible-validator into .claude/skills/ansible-validator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ansible-validator", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/akin-ozer/cc-devops-skills/tree/main/devops-skills-plugin/skills/ansible-validatorType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add akin-ozer/cc-devops-skills --skill ansible-validator -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install akin-ozer/cc-devops-skills ansible-validator --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/akin-ozer/cc-devops-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/devops-skills-plugin/skills/ansible-validator .agents/skills/ansible-validator && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "ansible-validator" agent skill from https://github.com/akin-ozer/cc-devops-skills/tree/main/devops-skills-plugin/skills/ansible-validator into .agents/skills/ansible-validator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ansible-validator", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add akin-ozer/cc-devops-skills --skill ansible-validator -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install akin-ozer/cc-devops-skills ansible-validator --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/akin-ozer/cc-devops-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/devops-skills-plugin/skills/ansible-validator .cursor/skills/ansible-validator && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "ansible-validator" agent skill from https://github.com/akin-ozer/cc-devops-skills/tree/main/devops-skills-plugin/skills/ansible-validator into .cursor/skills/ansible-validator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ansible-validator", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/akin-ozer/cc-devops-skills.git --path devops-skills-plugin/skills/ansible-validator--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add akin-ozer/cc-devops-skills --skill ansible-validator -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install akin-ozer/cc-devops-skills ansible-validator --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/akin-ozer/cc-devops-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/devops-skills-plugin/skills/ansible-validator .gemini/skills/ansible-validator && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "ansible-validator" agent skill from https://github.com/akin-ozer/cc-devops-skills/tree/main/devops-skills-plugin/skills/ansible-validator into .gemini/skills/ansible-validator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ansible-validator", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install akin-ozer/cc-devops-skills ansible-validatorInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add akin-ozer/cc-devops-skills --skill ansible-validator -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/akin-ozer/cc-devops-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/devops-skills-plugin/skills/ansible-validator .github/skills/ansible-validator && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "ansible-validator" agent skill from https://github.com/akin-ozer/cc-devops-skills/tree/main/devops-skills-plugin/skills/ansible-validator into .github/skills/ansible-validator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ansible-validator", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add akin-ozer/cc-devops-skills --skill ansible-validator -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install akin-ozer/cc-devops-skills ansible-validator --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/akin-ozer/cc-devops-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/devops-skills-plugin/skills/ansible-validator .opencode/skills/ansible-validator && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "ansible-validator" agent skill from https://github.com/akin-ozer/cc-devops-skills/tree/main/devops-skills-plugin/skills/ansible-validator into .opencode/skills/ansible-validator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ansible-validator", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
ansible-validatorValidate, lint, audit, or debug Ansible playbooks, roles, inventories, FQCN, tasks.
Ansible Validator is an agent skill from akin-ozer/cc-devops-skills. Validate, lint, audit, or debug Ansible playbooks, roles, inventories, FQCN, tasks.
Its SKILL.md is about 10k tokens, which your agent loads only when the skill is triggered. The skill folder holds 82 other files, including scripts, reference files and assets (for example `references/best_practices.md`, `references/common_errors.md` and `references/module_alternatives.md`).
It sits in DevOps & Cloud, covering Infrastructure as code and Linting and formatting. It works with Ansible. The repository describes itself as: DevOps skills for Claude Code and Codex. The licence is Apache-2.0.
8 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 276af75. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 9 files in scripts/ (Shell and Python, from the files we listed), which the agent can run.
Shell commands in SKILL.md call:
bashansible-playbookdockerpodmanpippip3ansibleFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
checkov.ioFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Ansible Validator loads about 10k tokens when it runs, and up to ~23k if it reads all its reference files. Until then it costs about 25 tokens; SKILL.md has 3,037 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
- Over-permissive sudo rulesAutomated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from akin-ozer/cc-devops-skills at commit 276af75, republished under its Apache-2.0 licence (© akin-ozer). 3,037 words, ~10,221 tokens.
.claude/skills/ansible-validator/SKILL.md (or your agent's skills folder). This skill also uses 79 other files; get the full folder from GitHub.Comprehensive toolkit for validating, linting, and testing Ansible playbooks, roles, and collections. This skill provides automated workflows for ensuring Ansible code quality, syntax validation, dry-run testing with check mode and molecule, and intelligent documentation lookup for custom modules and collections with version awareness.
Default behavior: When validating any Ansible role with a molecule/ directory, attempt Molecule automatically using bash scripts/test_role.sh <role-path>. If Molecule cannot run due to environment/runtime limits, mark Molecule as BLOCKED, report why, and continue all non-Molecule validation steps.
Use this skill when the request is about validating or debugging existing Ansible code, not generating new code.
Common trigger phrases:
Apply this skill when encountering any of these scenarios:
.yml, .yaml playbooks, roles, inventories, vars)ansible-playbook --checkRun preflight before validation to avoid dead ends:
bash scripts/setup_tools.shCommand path assumption: run commands from this skill root (devops-skills-plugin/skills/ansible-validator) or use absolute paths.
Preflight requirements:
ansible, ansible-playbook, ansible-lint (plus yamllint recommended)molecule plus an available runtime (docker or podman)checkov (wrapper can bootstrap if missing)Deterministic fallback rules:
BLOCKED, and continue.BLOCKED, and continue remaining stages.Use wrappers by default for consistent behavior and fallback handling.
| Validation scenario | Default command | Use direct command when | Fallback if command cannot run |
|---|---|---|---|
| Playbook syntax/lint | bash scripts/validate_playbook.sh <playbook.yml> | User asks for a single focused check only (ansible-playbook --syntax-check, ansible-lint, or yamllint) | Run any available direct checks and report skipped checks as BLOCKED |
| Role structural validation | bash scripts/validate_role.sh <role-dir> | User asks only for specific sub-checks (for example, structure only) | Run structure/YAML checks that are possible and report missing stages |
| Role Molecule execution | bash scripts/test_role.sh <role-dir> [scenario] | User explicitly asks for manual stage-by-stage Molecule commands | Mark Molecule BLOCKED with reason and continue non-Molecule role checks |
| Security scanning | bash scripts/validate_playbook_security.sh <path> or bash scripts/validate_role_security.sh <path> plus bash scripts/scan_secrets.sh <path> | User requests raw Checkov output formatting or custom flags | Run whichever scanner is available; if one is missing, run the other and report coverage gap |
| Module/collection discovery | bash scripts/extract_ansible_info_wrapper.sh <path> | Python environment is already known-good and user wants direct parser output | If extraction fails, manually inspect requirements.yml/galaxy.yml and continue with best-effort lookup |
Follow this deterministic workflow and never stop at a missing dependency:
0. Preflight
├─> Run: bash scripts/setup_tools.sh
├─> Record tool/runtime readiness
└─> Continue even when optional tools are missing
1. Identify scope
├─> Single playbook validation
├─> Role validation
├─> Collection validation
└─> Multi-playbook/inventory validation
2. Syntax Validation
├─> Run ansible-playbook --syntax-check
├─> Run yamllint for YAML syntax
└─> Report as PASS/FAIL/BLOCKED
3. Lint and Best Practices
├─> Run ansible-lint (comprehensive linting)
├─> Check for deprecated modules (see references/module_alternatives.md)
├─> **DETECT NON-FQCN MODULE USAGE** (apt vs ansible.builtin.apt)
│ └─> Run bash scripts/check_fqcn.sh to identify short module names
│ └─> Recommend FQCN alternatives from references/module_alternatives.md
├─> Verify role structure
└─> Report linting issues
4. Dry-Run Testing (check mode)
├─> Run ansible-playbook --check (if inventory available)
├─> Analyze what would change
└─> Report potential issues
5. Molecule Testing (for roles with molecule/) - AUTOMATIC ATTEMPT
├─> Check if molecule/ directory exists in role
├─> If present, run: bash scripts/test_role.sh <role-path> [scenario]
├─> If script exits 2, mark Molecule as BLOCKED (environment/runtime issue)
├─> If script exits 1, mark Molecule as FAIL (role/test issue)
└─> Continue remaining validation regardless of Molecule outcome
6. Custom Module/Collection Analysis (if detected)
├─> Extract module/collection information
├─> Identify versions
├─> Lookup documentation (Context7 first, then web.search_query fallback)
└─> Provide version-specific guidance
7. Security and Best Practices Review - DUAL SCANNING DEFAULT
├─> Run bash scripts/validate_playbook_security.sh or validate_role_security.sh (Checkov)
├─> Run bash scripts/scan_secrets.sh for hardcoded secret detection
│ └─> This catches secrets Checkov may miss (passwords, API keys, tokens)
├─> If one scanner is unavailable, run the other and report reduced coverage
├─> Validate privilege escalation
├─> Review file permissions
└─> Identify common anti-patterns
8. Reference Routing
├─> Map each error/warning class to the matching reference file
├─> Extract concrete remediation from references (not file-name-only mention)
└─> Include source section + fix guidance in final report
9. Final Report (required format)
├─> Summary counts: PASS / FAIL / BLOCKED / SKIPPED
├─> Findings grouped by severity
├─> Tool/runtime blockers with exact command that failed
└─> Next actions to reach full validation coverageStatus contract: BLOCKED means validation could not run due to environment/runtime constraints; FAIL means the Ansible code or tests failed.
When issues are detected, consult the mapped reference and include a specific remediation excerpt in the report.
| Error class | Typical detector | Required reference | Required action |
|---|---|---|---|
| YAML parse/format errors | yamllint, ansible-playbook --syntax-check | references/common_errors.md (Syntax Errors) | Quote the matching syntax fix pattern and apply corrected YAML structure |
| Module/action resolution errors | ansible-playbook, ansible-lint | references/common_errors.md (Module/Collection Errors) | Provide install/version fix commands (ansible-galaxy collection install ...) |
| Deprecated or non-FQCN module usage | ansible-lint, bash scripts/check_fqcn.sh | references/module_alternatives.md | Provide exact FQCN/module replacement per finding |
| Template/variable errors | ansible-playbook, check mode | references/common_errors.md (Template/Variable Errors), references/best_practices.md (Variable Management) | Recommend default(), required(), or type conversion fixes |
| Connection/inventory/privilege errors | ansible-playbook --check, runtime output | references/common_errors.md (Connection, Inventory, Privilege sections) | Provide corrected inventory/auth/become configuration |
| Security policy failures (CKV_*) | validate_*_security.sh / Checkov | references/security_checklist.md | Map failed policy to a secure task rewrite |
| Hardcoded secrets | bash scripts/scan_secrets.sh | references/security_checklist.md (Secrets Management) | Replace with Vault/env/external secret manager approach |
| Role structure/idempotency warnings | validate_role.sh, Molecule idempotence | references/best_practices.md | Provide role layout or idempotency remediation steps |
External documentation lookup trigger:
Purpose: Ensure YAML files are syntactically correct before Ansible parsing.
Tools:
yamllint - YAML linter for syntax and formattingansible-playbook --syntax-check - Ansible-specific syntax validationWorkflow:
# Check YAML syntax with yamllint
yamllint playbook.yml
# Or for entire directory
yamllint -c .yamllint .
# Check Ansible playbook syntax
ansible-playbook playbook.yml --syntax-checkCommon Issues Detected:
Best Practices:
.yamllintPurpose: Enforce Ansible best practices and catch common errors.
Workflow:
# Lint a single playbook
ansible-lint playbook.yml
# Lint all playbooks in directory
ansible-lint .
# Lint with specific rules
ansible-lint -t yaml,syntax playbook.yml
# Skip specific rules
ansible-lint -x yaml[line-length] playbook.yml
# Output parseable format
ansible-lint -f pep8 playbook.yml
# Show rule details
ansible-lint -LCommon Issues Detected:
command vs shellbecome directivesSeverity Levels:
Auto-fix approach:
--fix for auto-fixable issuesPurpose: Identify security vulnerabilities and compliance violations in Ansible code using Checkov, a static code analysis tool for infrastructure-as-code.
What Checkov Provides Beyond ansible-lint:
While ansible-lint focuses on code quality and best practices, Checkov specifically targets security policies and compliance:
Workflow:
# Scan playbook for security issues
bash scripts/validate_playbook_security.sh playbook.yml
# Scan entire directory
bash scripts/validate_playbook_security.sh /path/to/playbooks/
# Scan role for security issues
bash scripts/validate_role_security.sh roles/webserver/
# Direct checkov usage
checkov -d . --framework ansible
# Scan with specific output format
checkov -d . --framework ansible --output json
# Scan and skip specific checks
checkov -d . --framework ansible --skip-check CKV_ANSIBLE_1Common Security Issues Detected:
Certificate Validation:
HTTPS Enforcement:
Package Security:
Error Handling:
Cloud Security (when managing cloud resources):
Example Violation:
# BAD - Disables certificate validation
- name: Download file
get_url:
url: https://example.com/file.tar.gz
dest: /tmp/file.tar.gz
validate_certs: false # Security issue!
# GOOD - Certificate validation enabled
- name: Download file
get_url:
url: https://example.com/file.tar.gz
dest: /tmp/file.tar.gz
validate_certs: true # Or omit (true by default)Integration with Validation Workflow:
Checkov complements ansible-lint:
Best Practice: Run both tools for comprehensive validation:
# Complete validation workflow
bash scripts/validate_playbook.sh playbook.yml # Syntax + Lint
bash scripts/validate_playbook_security.sh playbook.yml # SecurityOutput Format:
Checkov provides clear security scan results:
Security Scan Results:
Passed: 15 checks
Failed: 2 checks
Skipped: 0 checks
Failed Checks:
Check: CKV_ANSIBLE_2 - "Ensure that certificate validation isn't disabled with get_url"
FAILED for resource: tasks/main.yml:download_file
File: /roles/webserver/tasks/main.yml:10-15Remediation Resources:
references/security_checklist.mdreferences/best_practices.mdInstallation:
Checkov is automatically installed in a temporary environment if not available system-wide. For permanent installation:
pip3 install checkovWhen to Use:
Purpose: Validate playbook syntax without executing tasks.
Workflow:
# Basic syntax check
ansible-playbook playbook.yml --syntax-check
# Syntax check with inventory
ansible-playbook -i inventory playbook.yml --syntax-check
# Syntax check with extra vars
ansible-playbook playbook.yml --syntax-check -e @vars.yml
# Check all playbooks
for file in *.yml; do
ansible-playbook "$file" --syntax-check
doneValidation Checks:
Error Handling:
Purpose: Preview changes that would be made without actually applying them.
Workflow:
# Run in check mode (dry-run)
ansible-playbook -i inventory playbook.yml --check
# Check mode with diff
ansible-playbook -i inventory playbook.yml --check --diff
# Check mode with verbose output
ansible-playbook -i inventory playbook.yml --check -v
# Check mode for specific hosts
ansible-playbook -i inventory playbook.yml --check --limit webservers
# Check mode with tags
ansible-playbook -i inventory playbook.yml --check --tags deploy
# Step through tasks
ansible-playbook -i inventory playbook.yml --check --stepCheck Mode Analysis:
When reviewing check mode output, focus on:
Task Changes:
ok: No changes neededchanged: Would make changesfailed: Would fail (check for check_mode support)skipped: Conditional skipDiff Output:
Handlers:
Failed Tasks:
check_mode: no overrideLimitations:
Safety Considerations:
Purpose: Test Ansible roles in isolated environments with multiple scenarios.
Automatic attempt policy: When validating any Ansible role with a molecule/ directory, automatically attempt Molecule tests using bash scripts/test_role.sh <role-path> [scenario].
When to Use:
Workflow:
# Initialize molecule for a role
cd roles/myrole
molecule init scenario --driver-name docker
# List scenarios
molecule list
# Run full test sequence
molecule test
# Individual test stages
molecule create # Create test instances
molecule converge # Run Ansible against instances
molecule verify # Run verification tests
molecule destroy # Destroy test instances
# Test with specific scenario
molecule test -s alternative
# Debug mode
molecule --debug test
# Keep instances for debugging
molecule converge
molecule login # SSH into test instanceTest Sequence:
dependency - Install role dependencieslint - Run yamllint and ansible-lintcleanup - Clean up before testingdestroy - Destroy existing instancessyntax - Run syntax checkcreate - Create test instancesprepare - Prepare instances (install requirements)converge - Run the roleidempotence - Run again, verify no changesside_effect - Optional side effect playbookverify - Run verification tests (Testinfra, etc.)cleanup - Final cleanupdestroy - Destroy test instancesMolecule Configuration:
Check molecule/default/molecule.yml:
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: instance
image: ubuntu:22.04
provisioner:
name: ansible
verifier:
name: ansibleVerification Tests:
Molecule supports multiple verifiers:
Example Ansible verifier (molecule/default/verify.yml):
---
- name: Verify
hosts: all
tasks:
- name: Check service is running
service:
name: nginx
state: started
check_mode: true
register: result
failed_when: result.changedCommon Molecule Errors:
Molecule Skip/Fallback Policy (Required):
molecule/ does not exist: mark Molecule as SKIPPED and continue.test_role.sh exits 2: mark Molecule as BLOCKED (missing/unavailable runtime dependency) and continue.test_role.sh exits 1: mark Molecule as FAIL (role/test issue) and continue.Use this reporting language for blocked Molecule runs:
Molecule Status: BLOCKED
Reason: <missing dependency/runtime and failing command>
Fallback Applied: Completed syntax, lint, check-mode, and security validation without Molecule runtime tests.
Next Action: <install/start dependency>; rerun `bash scripts/test_role.sh <role-path> [scenario]`Purpose: Automatically discover and retrieve version-specific documentation for custom modules and collections using web search and Context7 MCP.
When to Trigger:
Detection Workflow:
Extract Module Information:
scripts/extract_ansible_info_wrapper.sh to parse playbooks and rolesrequirements.ymlExtract Collection Information:
community.general, ansible.posix)requirements.yml or galaxy.ymlDocumentation Lookup Strategy:
Use this deterministic lookup order:
mcp__context7__resolve-library-idmcp__context7__query-docsweb.search_query with versioned queriesREADME, module docs, role docs) firstSearch Query Templates:
# For custom modules
"[module-name] ansible module version [version] documentation"
"[module-name] ansible [module-type] example"
"ansible [collection-name].[module-name] parameters"
# For custom collections
"ansible collection [collection-name] version [version]"
"[collection-namespace].[collection-name] ansible documentation"
"ansible galaxy [collection-name] modules"
# For specific errors
"ansible [module-name] error: [error-message]"
"ansible [collection-name] module failed"Example Workflow:
User working with: community.docker.docker_container version 3.0.0
1. Extract module info from playbook:
tasks:
- name: Start container
community.docker.docker_container:
name: myapp
image: nginx:latest
2. Detect collection: community.docker
3. Search for documentation:
- Try Context7: mcp__context7__resolve-library-id("ansible community.docker")
- Fallback to web.search_query("ansible community.docker collection version 3.0 docker_container module documentation")
4. If official docs found:
- Parse module parameters (required vs optional)
- Identify return values
- Find usage examples
- Check version compatibility
5. Provide version-specific guidance to userVersion Compatibility Checks:
Common Collection Sources:
Purpose: Identify security vulnerabilities and anti-patterns in Ansible playbooks.
Security Checks:
Secrets Detection:
# Check for hardcoded credentials
grep -r "password:" *.yml
grep -r "secret:" *.yml
grep -r "api_key:" *.yml
grep -r "token:" *.ymlRemediation: Use Ansible Vault, environment variables, or external secret management
Privilege Escalation:
become: yesbecome_user specificationFile Permissions:
Command Injection:
quote filter for user inputNetwork Security:
Best Practices:
Playbook Organization:
Variable Management:
default() filterTask Naming:
Idempotency:
creates, removes for command taskschanged_when: false unless necessaryError Handling:
failed_when for custom failure conditionsblock/rescue/always for error recoveryany_errors_fatalignore_errors sparinglyDocumentation:
Reference Documentation:
For detailed security guidelines and best practices, refer to:
references/security_checklist.md - Common security vulnerabilitiesreferences/best_practices.md - Ansible coding standardsreferences/common_errors.md - Common errors and solutionsRun this preflight before validation:
# Preferred one-shot preflight
bash scripts/setup_tools.sh
# Check Ansible installation
ansible --version
ansible-playbook --version
# Check ansible-lint installation
ansible-lint --version
# Check yamllint installation
yamllint --version
# Check molecule installation (for role testing with molecule/)
molecule --version
# Check container runtime for Molecule
docker --version
docker info
# or
podman --version
podman info
# Install missing tools (example for pip)
pip install ansible ansible-lint yamllint ansible-compat
# Install molecule with docker driver
pip install molecule molecule-docker
# Install molecule with podman driver (alternative)
pip install molecule molecule-podmanMinimum Versions:
Execution policy when tools are missing:
ansible/ansible-lint are missing, wrappers (validate_playbook.sh, validate_role.sh) attempt temporary venv bootstrap.docker info or podman info) is unavailable, Molecule is BLOCKED and non-Molecule checks continue.checkov is missing, security wrappers bootstrap it when possible; otherwise run scan_secrets.sh and report reduced security coverage.Optional Tools:
ansible-inventory - Inventory validation and graphingansible-doc - Module documentation lookupjq - JSON parsing for structured outputError: Module Not Found
Solution: Install required collection with ansible-galaxy
Check collections/requirements.yml
Verify collection namespace and nameError: Undefined Variable
Solution: Define variable in vars, defaults, or group_vars
Check variable precedence
Use default() filter for optional variables
Verify variable file is includedError: Template Syntax Error
Solution: Check Jinja2 template syntax
Verify variable types match filters
Ensure proper quote escaping
Test template rendering separatelyError: Connection Failed
Solution: Verify inventory host accessibility
Check SSH configuration and keys
Verify ansible_host and ansible_port
Test with ansible -m pingError: Permission Denied
Solution: Add become: yes for privilege escalation
Verify sudo/su configuration
Check file permissions
Verify user has necessary privilegesError: Deprecated Module
Solution: Check ansible-lint output for replacement
Consult module documentation for alternatives
Update to recommended module
Test functionality with new modulesetup_tools.sh - Preflight checker for Ansible validator dependencies. Verifies baseline tools (ansible, ansible-playbook, ansible-lint, yamllint) and Molecule runtime readiness (docker/podman) and provides installation guidance.
Usage:
bash scripts/setup_tools.shextract_ansible_info_wrapper.sh - Bash wrapper for extract_ansible_info.py that automatically handles PyYAML dependencies. Creates a temporary venv if PyYAML is not available in system Python.
Usage:
bash scripts/extract_ansible_info_wrapper.sh <path-to-playbook-or-role>Output: JSON structure with modules, collections, and versions
extract_ansible_info.py - Python script (called by wrapper) to parse Ansible playbooks and roles to extract module usage, collection dependencies, and version information. The wrapper script handles dependency management automatically.
validate_playbook.sh - Comprehensive validation script that runs syntax check, yamllint, and ansible-lint on playbooks. Automatically installs ansible and ansible-lint in a temporary venv if not available on the system (prefers system versions when available).
Usage:
bash scripts/validate_playbook.sh <playbook.yml>validate_playbook_security.sh - Security validation script that scans playbooks for security vulnerabilities using Checkov. Automatically installs checkov in a temporary venv if not available. Complements validate_playbook.sh by focusing on security-specific checks like SSL/TLS validation, HTTPS enforcement, and package signature verification.
Usage:
bash scripts/validate_playbook_security.sh <playbook.yml>
# Or scan entire directory
bash scripts/validate_playbook_security.sh /path/to/playbooks/validate_role.sh - Comprehensive role validation script that checks role structure, YAML syntax, Ansible syntax, linting, and molecule configuration.
Usage:
bash scripts/validate_role.sh <role-directory>Validates:
validate_role_security.sh - Security validation script for Ansible roles using Checkov. Scans entire role directory for security issues. Automatically installs checkov in a temporary venv if not available. Complements validate_role.sh with security-focused checks.
Usage:
bash scripts/validate_role_security.sh <role-directory>test_role.sh - Wrapper script for Molecule testing with automatic dependency installation. If molecule is missing, it creates a temporary venv and installs dependencies. Returns exit code 2 for environment/runtime blockers (for example missing Docker/Podman runtime) and exit code 1 for role/test failures.
Usage:
bash scripts/test_role.sh <role-directory> [scenario]scan_secrets.sh - Comprehensive secret scanner that uses grep-based pattern matching to detect hardcoded secrets in Ansible files. Complements Checkov security scanning by catching secrets that static analysis may miss, including passwords, API keys, tokens, AWS credentials, and private keys.
Usage:
bash scripts/scan_secrets.sh <playbook.yml|role-directory|directory>Detects:
IMPORTANT: This script should ALWAYS be run alongside Checkov (validate_*_security.sh) for comprehensive security scanning. Checkov catches SSL/TLS and protocol issues; this script catches hardcoded secrets.
check_fqcn.sh - Scans Ansible files to identify modules using short names instead of Fully Qualified Collection Names (FQCN). Recommends migration to ansible.builtin.* or appropriate collection namespace for better clarity and future compatibility.
Usage:
bash scripts/check_fqcn.sh <playbook.yml|role-directory|directory>Detects:
Provides specific migration recommendations with FQCN alternatives.
validate_inventory.sh - Validates Ansible inventory files and directories. Checks YAML syntax, resolves host/group hierarchy, and flags common structural issues such as plaintext credentials and missing ansible_connection=local for localhost entries. Automatically installs ansible in a temporary venv if not available.
Usage:
bash scripts/validate_inventory.sh <inventory-file|inventory-directory>Validation stages:
ansible-inventory --list to verify host/group resolutionansible-inventory --graph to display group hierarchysecurity_checklist.md - Comprehensive security validation checklist for Ansible playbooks covering secrets management, privilege escalation, file permissions, and command injection.
best_practices.md - Ansible coding standards and best practices for playbook organization, variable handling, task naming, idempotency, and documentation.
common_errors.md - Database of common Ansible errors with detailed solutions and prevention strategies.
module_alternatives.md - Guide for replacing deprecated modules with current alternatives.
.yamllint - Pre-configured yamllint rules for Ansible YAML files.
.ansible-lint - Pre-configured ansible-lint configuration with reasonable rule settings.
molecule.yml.template - Template molecule configuration for role testing.
User: "Check if this playbook.yml file is valid"
Steps:
1. Run preflight: `bash scripts/setup_tools.sh`
2. Run wrapper: `bash scripts/validate_playbook.sh playbook.yml`
3. If inventory is provided, run check mode: `ansible-playbook -i <inventory> playbook.yml --check --diff`
4. Run security wrappers:
- `bash scripts/validate_playbook_security.sh playbook.yml`
- `bash scripts/scan_secrets.sh playbook.yml`
5. If custom modules are detected, run docs lookup workflow (Context7 first, web fallback)
6. Report results with PASS/FAIL/BLOCKED/SKIPPED counts and remediation stepsUser: "Validate my ansible role in ./roles/webserver/"
Steps:
1. Run preflight: `bash scripts/setup_tools.sh`
2. Run role wrapper: `bash scripts/validate_role.sh ./roles/webserver/`
3. This checks:
- Role directory structure (tasks/, defaults/, handlers/, meta/, etc.)
- Required main.yml files
- YAML syntax with yamllint
- Ansible syntax with ansible-playbook
- Best practices with ansible-lint
- Molecule configuration (if present)
4. If `molecule/` exists, attempt Molecule automatically:
- `bash scripts/test_role.sh ./roles/webserver/`
- Exit `2`: report `Molecule Status: BLOCKED` with reason, continue remaining checks
- Exit `1`: report `Molecule Status: FAIL` with debugging guidance
5. Run role security checks:
- `bash scripts/validate_role_security.sh ./roles/webserver/`
- `bash scripts/scan_secrets.sh ./roles/webserver/`
6. If custom modules detected, run documentation lookup workflow
7. Provide final report with severity, blockers, and rerun actionsUser: "Run playbook in check mode for production servers"
Steps:
1. Verify inventory file exists
2. Run ansible-playbook --check --diff -i production
3. Analyze check mode output
4. Highlight tasks that would change
5. Review handler notifications
6. Flag any security concerns
7. Provide recommendation on safety of applyingUser: "I'm using community.postgresql.postgresql_db version 2.3.0, what parameters are available?"
Steps:
1. Try Context7 MCP: `mcp__context7__resolve-library-id("ansible community.postgresql")`
2. If found, query docs with `mcp__context7__query-docs` for `postgresql_db`
3. If not found, use `web.search_query`: "ansible community.postgresql version 2.3.0 postgresql_db module documentation"
4. Extract module parameters (required vs optional)
5. Provide examples of common usage patterns
6. Note any version-specific considerationsUser: "Test my nginx role with molecule"
Steps:
1. Check if molecule is configured in role
2. Run preflight (`bash scripts/setup_tools.sh`) and confirm Docker/Podman runtime availability
3. Run `bash scripts/test_role.sh <role-path> [scenario]`
4. If exit code is `2`, mark Molecule `BLOCKED`, report reason, and continue non-Molecule checks
5. If exit code is `1`, inspect converge/verify output and report role issues
6. Analyze idempotency, syntax, and verification outcomes
7. Suggest improvements and exact rerun commandThis skill works well in combination with:
BLOCKED (not silent skip), and continue with remaining stages.common_errors, best_practices, module_alternatives, security_checklist).This skill execution is complete when:
ansible, ansible-lint, and Molecule runtime status when role tests are in scope).PASS, FAIL, BLOCKED, and SKIPPED.© akin-ozer, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 79 other files (scripts, references, assets) in devops-skills-plugin/skills/ansible-validator of akin-ozer/cc-devops-skills.
Open the folder on GitHubat commit 276af75
Ansible Validator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Ansible Validator this skillakin-ozer/cc-devops-skills | 320 | — | ~10k | Automated safety check: Notes | Apache-2.0 | |
| Wdio Testingansible/vscode-ansible | 488 | — | ~2.2k | Automated safety check: Pass | MIT | |
| Spa Create Configsplunk/splunk-platform-automator | 138 | — | ~3.5k | Automated safety check: Pass | Proprietary | |
| Azure Bicep Skilltimothywarner-org/claude-code | 224 | — | ~2.9k | Automated safety check: Pass | MIT | |
| Spa Add Test Scenariosplunk/splunk-platform-automator | 138 | — | ~2.2k | Automated safety check: Pass | Proprietary | |
| Frontend Overlayansible/ansible-ui | 113 | — | ~2.5k | Automated safety check: Notes | Apache-2.0 |
ansible/vscode-ansible
Write, run, and debug WebDriverIO (WDIO) UI tests for the Ansible VS Code extension.
splunk/splunk-platform-automator
A skill your agent uses when creating or updating splunkconfig.yml, designing Splunk Enterprise lab topology, multisite IDXC, SHC layout, architecture plan before config, or AWS Terraform block for…
timothywarner-org/claude-code
A skill your agent uses when authoring, reviewing, or refactoring Azure Bicep code.
splunk/splunk-platform-automator
A skill your agent uses when adding app scope/routing test coverage (deployer, CM, DS, direct).
ansible/ansible-ui
Product-specific frontend wrappers, API clients, and paths for ansible-ui.
ansible-collections/ansible.mysql
Runs and writes tests (sanity, unit, integration) for the ansible.mysql Ansible collection using ansible-test.
akin-ozer/cc-devops-skills
Create, generate, or scaffold GitHub Actions workflows, action.yml, or .github/workflows CI/CD pipelines.
akin-ozer/cc-devops-skills
Create, scaffold, or generate Helm charts, Chart.yaml, values.yaml, templates, helpers.
akin-ozer/cc-devops-skills
Generate/create/scaffold Jenkinsfile — declarative, scripted, shared library, CI/CD pipelines.
akin-ozer/cc-devops-skills
Validate, lint, audit, or scan a Dockerfile for security and best practices.
akin-ozer/cc-devops-skills
Validate, lint, audit, fix GitHub Actions workflows (.github/workflows).
akin-ozer/cc-devops-skills
Validate, lint, audit, or check Jenkinsfiles and shared libraries.
Works with
Categories
Validate, lint, audit, or debug Ansible playbooks, roles, inventories, FQCN, tasks. Ansible Validator is an agent skill from akin-ozer/cc-devops-skills. Validate, lint, audit, or debug Ansible playbooks, roles, inventories, FQCN, tasks.
Ansible Validator fits situations like: tasks that involve Infrastructure as code; tasks that involve Linting and formatting.
Run `npx skills add akin-ozer/cc-devops-skills --skill ansible-validator -a claude-code`. Or copy the skill folder (devops-skills-plugin/skills/ansible-validator in akin-ozer/cc-devops-skills) into .claude/skills/ansible-validator in your project. Claude Code loads it when a task matches its description.
Run `npx skills add akin-ozer/cc-devops-skills --skill ansible-validator -a codex`. Or copy the skill folder (devops-skills-plugin/skills/ansible-validator in akin-ozer/cc-devops-skills) into .agents/skills/ansible-validator in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add akin-ozer/cc-devops-skills --skill ansible-validator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ansible-validator, .gemini/skills/ansible-validator, .github/skills/ansible-validator and .opencode/skills/ansible-validator in your project.
Going by SKILL.md and its folder, Ansible Validator needs a shell and Python for the scripts in its folder and the command-line tools its instructions call (bash, ansible-playbook, docker, podman, pip and pip3). Our summary lists: Python 3; A Bash shell; Docker.
SKILL.md names 1 domain. As links in the text: checkov.io. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (runs commands with sudo), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Ansible Validator is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 10k tokens (SKILL.md is roughly 41k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 13k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Ansible Validator: Wdio Testing (ansible/vscode-ansible, 488 stars), Spa Create Config (splunk/splunk-platform-automator, 138 stars), Azure Bicep Skill (timothywarner-org/claude-code, 224 stars) and Spa Add Test Scenario (splunk/splunk-platform-automator, 138 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
akin-ozer (a GitHub user) maintains it in akin-ozer/cc-devops-skills, which has 320 GitHub stars. The repository holds 30 skills in this directory. The repository was last updated on July 26, 2026.
Source: akin-ozer/cc-devops-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.