creating-ansible-playbooks

Create, validate, and security-scan Ansible playbooks with templates and container-based testing.

1|Updated Feb 10, 2026
One-click install
npx skills add https://github.com/stefanfaur/roach-marketplace --skill creating-ansible-playbooks-stefanfaur
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: creating-ansible-playbooks
Source: https://github.com/stefanfaur/roach-marketplace/tree/main/ansible-playbook-creator/skills/creating-ansible-playbooks
Command: npx skills add https://github.com/stefanfaur/roach-marketplace --skill creating-ansible-playbooks-stefanfaur

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pyyaml, ansible, ansible-lint, docker, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? Writing Ansible playbooks by hand often leads to syntax errors, hardcoded credentials, and untested automation that fails in production. This Skill guides playbook creation and provides validation, security scanning, and container-based testing to catch issues before deployment. ## Core Features & Use Cases - Playbook Creation Guidance: Step-by-step workflow covering assessment, design, implementation, validation, and production deployment, backed by a ready-to-use playbook template. - Syntax and Structure Validation: The validate_playbook.py script checks YAML syntax, required fields, tasks, handlers, and variables, with optional ansible-lint integration. - Security Scanning: The secure_playbook.py script detects hardcoded credentials, dangerous modules, command injection risks, and unsafe privilege escalation patterns. - Container-Based Testing: The test_playbook.sh script executes playbooks inside a Docker container for isolated verification. - Use Case: A DevOps engineer writes a new deployment playbook, runs the validator to fix structural issues, scans it for leaked secrets, and tests it in an Ubuntu container before pushing to production. ## Quick Start Ask the assistant to create an Ansible playbook for your automation task, then validate and security-scan it before running it in a test container.

Frequently Asked Questions about creating-ansible-playbooks

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

FAQPage Schema
How do I validate an Ansible playbook before running it?▼

Run the validate_playbook.py script against your YAML file to check syntax, structure, required fields like hosts, and task definitions. It also integrates ansible-lint when available and supports a strict mode that treats warnings as errors.

How to scan Ansible playbooks for hardcoded credentials?▼

Use the secure_playbook.py security scanner, which detects hardcoded passwords, API keys, tokens, and unsafe patterns like disabled SSL verification. It outputs a JSON report with vulnerabilities, warnings, and remediation recommendations such as using Ansible Vault.

Can I test an Ansible playbook in a Docker container?▼

Yes, the test_playbook.sh script creates a Docker container, installs Ansible inside it, copies your playbook, and executes it in isolation. It supports custom images, tags, extra variables, and optional container retention for debugging.

What dependencies are required to run the playbook validation scripts?▼

The Python scripts require PyYAML, and full validation needs ansible-playbook and optionally ansible-lint installed. Container-based testing additionally requires Docker and the ansible-playbook CLI on the host.

Why does my Ansible playbook fail security scanning?▼

Common causes include hardcoded credentials in variables, use of shell or command modules with injection-prone patterns, and privilege escalation without a vault-managed password. Move secrets to Ansible Vault and replace shell commands with dedicated modules.