ansible-validator

Validate Ansible playbooks, roles, and collections with yamllint, ansible-lint, and Checkov.

290|32|Updated Dec 5, 2025
One-click install
npx skills add https://github.com/akin-ozer/cc-devops-skills --skill ansible-validator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ansible-validator
Source: https://github.com/akin-ozer/cc-devops-skills/tree/main/devops-skills-plugin/skills/ansible-validator
Command: npx skills add https://github.com/akin-ozer/cc-devops-skills --skill ansible-validator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires PyYAML, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Comprehensive toolkit for validating, linting, and testing Ansible code (playbooks, roles, and collections). It streamlines syntax checks, enforces best practices, and coordinates security validations to reduce deployment risk and debugging time.

Core Features & Use Cases

  • YAML/Ansible syntax validation with yamllint and ansible-playbook --syntax-check to catch structural issues early.
  • Linting and quality checks with ansible-lint, plus automated security validation using Checkov.
  • Molecule-based testing support for roles (automatic execution when a molecule/ directory is present) to verify idempotency and cross-platform compatibility.

Quick Start

Validate a single playbook: bash scripts/validate_playbook.sh path/to/playbook.yml. Validate a role: bash scripts/validate_role.sh roles/my_role. Detect non-FQCN usage: bash scripts/check_fqcn.sh path/to/playbook-or-role.

Frequently Asked Questions about ansible-validator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate and lint Ansible playbooks for syntax and security issues?

Ansible validation and linting automates syntax checks using yamllint and ansible-lint, while security analysis is performed by Checkov. This catches structural issues and enforces best practices across playbooks to reduce deployment risk and debugging time.

Does Ansible role testing support Molecule for verifying idempotency?

Yes, Molecule testing for Ansible roles is automatically executed when a molecule/ directory is present. This verifies role idempotency and cross-platform compatibility to ensure reliable infrastructure code before deployment.

What is the best way to check for non-FQCN usage in Ansible code?

Checking for non-FQCN usage in Ansible code is handled by a dedicated script that scans playbooks and roles. It detects fully qualified collection names to enforce standard module naming conventions and improve code portability.

Do I need to pre-install yamllint, ansible-lint, and Checkov to validate Ansible code?

No, you do not need to pre-install yamllint, ansible-lint, or Checkov. The Ansible validator automatically installs these required tools into a temporary environment if they are missing, allowing immediate validation workflows.

Can I validate Ansible collections and roles using a single automated workflow?

Yes, you can validate Ansible collections and roles in a single workflow. The toolkit coordinates syntax validation, quality checks, and security analysis across playbooks, roles, and collections to streamline infrastructure code shipping.