home / skills / ehtbanton / claudeskillsrepo / ansible-playbook-generator

ansible-playbook-generator skill

/ansible-playbook-generator

This skill generates a complete Ansible playbook with inventory and roles, accelerating infrastructure automation and configuration management.

npx playbooks add skill ehtbanton/claudeskillsrepo --skill ansible-playbook-generator

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
766 B
---
name: ansible-playbook-generator
description: Generate Ansible playbook files for infrastructure automation and configuration management. Triggers on "create ansible playbook", "generate ansible config", "ansible automation", "infrastructure playbook".
---

# Ansible Playbook Generator

Generate Ansible playbook files for infrastructure automation.

## Output Requirements

**File Output:** `playbook.yml`, `inventory.yml`, `roles/*/tasks/main.yml`
**Format:** Valid Ansible YAML
**Standards:** Ansible 2.15+

## When Invoked

Immediately generate a complete Ansible playbook with roles and inventory.

## Example Invocations

**Prompt:** "Create Ansible playbook for web server setup"
**Output:** Complete playbook with nginx, node.js, and ssl configuration.

Overview

This skill generates complete Ansible playbooks, inventories, and role task files for infrastructure automation and configuration management. It outputs production-ready YAML files compatible with Ansible 2.15+ and organizes roles under roles/* with tasks/main.yml. Use it to quickly scaffold repeatable deployments and standardize automation across environments.

How this skill works

When triggered, the skill inspects the request intent and immediately emits a set of files: playbook.yml, inventory.yml, and roles/*/tasks/main.yml. The generated YAML follows Ansible syntax and best practices for roles and inventories, including hosts/groups, variables, handlers, and idempotent task definitions. You can prompt for target services, OS families, or extras (SSL, users, packages) and the skill will tailor tasks and handlers accordingly.

When to use it

  • Bootstrapping a new server fleet with standardized roles and inventory
  • Scaffolding playbooks for web, database, or CI/CD components
  • Converting manual setup steps into repeatable, idempotent tasks
  • Generating example playbooks for documentation or training
  • Rapid prototyping of automation before adding complex logic

Best practices

  • Specify target OS family and versions to generate correct package managers and service names
  • Keep tasks idempotent and include appropriate handlers for service restarts
  • Use group_vars and host_vars in inventory for environment-specific configuration
  • Limit scope of generated roles to single responsibilities (web, db, ssl)
  • Review and test generated playbooks in a staging environment before production

Example use cases

  • Create Ansible playbook for web server setup with nginx, node.js, and SSL
  • Generate inventory and roles for a multi-tier app: web, app, and database hosts
  • Produce a Playbook that creates users, installs packages, and configures services
  • Scaffold automation for deploying a Docker host and pulling container images
  • Generate sample role layout for onboarding new DevOps engineers

FAQ

What files will the skill produce?

It outputs playbook.yml, inventory.yml, and roles/*/tasks/main.yml files organized for immediate use.

Which Ansible versions are supported?

Generated playbooks follow patterns compatible with Ansible 2.15 and later; verify any module-specific changes for newer versions.