Agent skill

Ansible Generator

by akin-ozer in akin-ozer/cc-devops-skills

Generate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars.

Apache-2.0Auto-check passedDevOps & Cloud

Install Ansible Generator

skills CLI
$ npx skills add akin-ozer/cc-devops-skills --skill ansible-generator -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install akin-ozer/cc-devops-skills ansible-generator --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ 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-generator .claude/skills/ansible-generator && rm -rf skills-src

Use ~/.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/

Facts

Skill name
ansible-generator
GitHub stars
320
Token cost
~2.3k tokens
SKILL.md length
926 words
Files
59 (incl. references, assets)
Skills in repo
30
Repo updated
First seen
Licence
Apache-2.0

At a glance

Generate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars.

  • Works in 5 steps: Classify Request Mode → Collect Minimum Inputs → Reference Extraction Checklist → …
  • Tasks that involve Infrastructure as code
  • SKILL.md covers Trigger Phrases, Deterministic Execution Flow, Validation Exceptions Matrix and Resource Generation Guidance, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Ansible Generator is an agent skill from akin-ozer/cc-devops-skills. Generate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 66 other files, including reference files and assets (for example `assets/templates/inventory/group_vars/all.yml`, `assets/templates/inventory/group_vars/databases.yml` and `assets/templates/inventory/group_vars/webservers.yml`).

It sits in DevOps & Cloud, covering Infrastructure as code. It works with Ansible. The repository describes itself as: DevOps skills for Claude Code and Codex. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Infrastructure as code

Example prompts

  • “/ansible-generator”

Requirements

  • Docker

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Classify Request Mode
  2. Collect Minimum Inputs
  3. Reference Extraction Checklist
  4. Generate
  5. Validate (Default) or Apply Exception (Fallback)

What it can do on your machine

Read from SKILL.md and the folder at commit 276af75. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Ansible Generator loads about 2.3k tokens when it runs, and up to ~15k if it reads all its reference files. Until then it costs about 27 tokens; SKILL.md has 926 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~27
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~15k

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.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated 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); files beside SKILL.md are not scanned.

SKILL.md

The full file from akin-ozer/cc-devops-skills at commit 276af75, republished under its Apache-2.0 licence (© akin-ozer). 926 words, ~2,292 tokens.

Download SKILL.mdSave it as .claude/skills/ansible-generator/SKILL.md (or your agent's skills folder). This skill also uses 58 other files; get the full folder from GitHub.
name
ansible-generator
description
Generate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars.

Ansible Generator

Trigger Phrases

Use this skill when the request is to generate or scaffold Ansible content, for example:

  • "Create a playbook to deploy nginx with TLS."
  • "Generate an Ansible role for PostgreSQL backups."
  • "Write inventory files for prod and staging."
  • "Build reusable Ansible tasks for user provisioning."
  • "Initialize an Ansible project with ansible.cfg and requirements.yml."
  • "Give me a quick Ansible snippet to install Docker."

Do not use this skill as the primary workflow when the request is validation/debug-only (syntax errors, lint failures, Molecule/test failures). Use ansible-validator for those cases.

Deterministic Execution Flow

Run these stages in order. Do not skip a stage unless the Validation Exceptions Matrix explicitly allows it.

Stage 0: Classify Request Mode

Determine one mode first:

ModeTypical user intentDeliverable
full-generation"create/build/generate" a full playbook/role/inventory/project file setComplete file(s), production-ready
snippet-only"quick snippet/example" without full file contextFocused task/play snippet
docs-onlyexplanation, pattern comparison, or conceptual guidance onlyExplanatory content, optional examples
Stage 1: Collect Minimum Inputs

If details are missing, ask briefly. If the user does not provide them, proceed with safe defaults and state assumptions.

Resource typeRequired inputsSafe defaults if missing
Playbooktarget hosts, privilege (become), OS family, objectivehosts: all, become: false, OS-agnostic modules
Rolerole name, primary service/package, supported OSrole name from task domain, Debian + RedHat vars
Tasks fileoperation scope, required vars, execution contextstandalone reusable tasks with documented vars
Inventoryenvironments, host groups, hostnames/IPsproduction/staging groups with placeholders
Project configcollections/roles dependencies, lint policyminimal ansible.cfg, requirements.yml, .ansible-lint
Stage 2: Reference Extraction Checklist

Before drafting content, extract the following from local references/templates.

Required references
  • references/best-practices.md
    • Extract: FQCN requirements, idempotency rules, naming, security expectations.
  • references/module-patterns.md
    • Extract: correct module/parameter patterns for the exact task type.
Required templates by output type
  • Playbook: assets/templates/playbook/basic_playbook.yml
  • Role: assets/templates/role/ (including meta/argument_specs.yml and molecule/default/ for test scaffolding)
  • Inventory (INI): assets/templates/inventory/hosts
  • Inventory (YAML): assets/templates/inventory/hosts.yml
  • Project config: assets/templates/project/ansible.cfg, assets/templates/project/requirements.yml, assets/templates/project/.ansible-lint
Extraction checks
  • Identify every [PLACEHOLDER] that must be replaced.
  • Decide module selection priority (ansible.builtin.* first).
  • Capture at least one OS-appropriate package pattern when OS-specific behavior is needed.
  • Capture required prerequisites (collections, binaries, target assumptions).
Stage 3: Generate

Apply these generation standards:

  1. Use FQCN module names (ansible.builtin.* first choice).
  2. Keep tasks idempotent (state, creates/removes, changed_when when needed).
  3. Use descriptive verb-first task names.
  4. Use true/false booleans (not yes/no).
  5. Add no_log: true for sensitive values.
  6. Replace all placeholders before presenting output.
  7. Prefer ansible.builtin.dnf for RHEL 8+/CentOS 8+ (legacy yum only for older systems).
Stage 4: Validate (Default) or Apply Exception (Fallback)

Use the matrix below to keep validation deterministic and non-blocking.

Validation Exceptions Matrix

ScenarioDefault behaviorAllowed fallbackWhat to report
full-generationRun ansible-validator after generation and after each fix passIf validator/tools are unavailable, run manual static checks (YAML shape, placeholder scan, FQCN/idempotency/security review) and provide exact deferred validation commandsExplicitly list which checks ran, which were skipped, and why
snippet-onlySkip full validator by default; do inline sanity checksRun full validator only if user asks or snippet is promoted to full fileState that validation was limited because output is snippet-only
docs-onlyNo runtime validationNone neededState that no executable artifact was generated
Offline environment (no web/docs access)Continue with local references and templatesSkip external doc lookups; prefer builtin-module implementations; provide notes for later external verificationState offline constraint and impacted checks/lookups
Show full SKILL.md (370 more words)Show less

Resource Generation Guidance

Playbooks
  • Use assets/templates/playbook/basic_playbook.yml as structure.
  • Include: header comments, pre_tasks/tasks/post_tasks as needed, handlers, tags.
  • Add health checks when service deployment/configuration is involved.
Roles
  • Build from assets/templates/role/ structure.
  • Keep defaults in defaults/main.yml; keep higher-priority role vars in vars/main.yml.
  • Include OS-specific vars (vars/Debian.yml, vars/RedHat.yml) when relevant.
  • Add meta/argument_specs.yml for variable validation.
  • Include molecule/default/ scaffold (from assets/templates/role/molecule/) for production-ready roles.
Task Files
  • Keep scope narrow and reusable.
  • Document required input variables in comments.
  • Use conditionals for environment/OS-sensitive operations.
Inventory
  • Build logical host groups and optional group hierarchies.
  • Use variable layering intentionally: group_vars/all.yml -> group -> host.
  • Default to INI format (hosts) for simple topologies; use YAML format (hosts.yml) when the user requests it or when the hierarchy is complex.
Project Configuration
  • Provide baseline ansible.cfg, requirements.yml, and .ansible-lint.
  • Keep defaults practical and editable.

Custom Modules and Collections

When the request depends on non-builtin modules/collections:

  1. Identify collection + module and required version sensitivity.
  2. Check local references/module-patterns.md first.
  3. If still unresolved and network/tools are available, query Context7:
    • mcp__context7__resolve-library-id
    • mcp__context7__query-docs
  4. If Context7 is unavailable, use official Ansible docs / Ansible Galaxy pages.
  5. If external lookup is unavailable, provide a builtin fallback approach and state the limitation.

Always include collection installation guidance when collection modules are used.

Canonical Example Flows

Flow A: Full Generation (Playbook)

User prompt: "Create a playbook to deploy nginx with TLS on Ubuntu and RHEL."

  1. Classify as full-generation.
  2. Gather/confirm required inputs (hosts, cert paths, become, service name).
  3. Extract required references (best-practices.md, module-patterns.md) and playbook template.
  4. Generate complete playbook with OS conditionals (apt/dnf), handlers, validation for config templates.
  5. Run ansible-validator.
  6. Fix issues and rerun until checks pass (or apply matrix fallback if tooling unavailable).
  7. Present output with validation summary, usage command, and prerequisites.
Flow B: Quick Snippet (Task Block)

User prompt: "Give me a snippet to create a user and SSH key."

  1. Classify as snippet-only.
  2. Extract minimal module patterns for ansible.builtin.user and ansible.builtin.authorized_key.
  3. Generate concise snippet with FQCN, idempotency, and variable placeholders.
  4. Perform inline sanity checks (YAML shape, FQCN, obvious idempotency/security).
  5. Present snippet and note that full validator run was skipped due to snippet-only mode.

Output Requirements

For generated executable artifacts, use this response structure:

markdown
## Generated [Resource Type]: [Name]

**Validation Status:** [Passed / Partially validated / Skipped with reason]
- YAML syntax: [status]
- Ansible syntax: [status]
- Lint: [status]

**Summary:**
- [What was generated]
- [Key implementation choices]

**Assumptions:**
- [Defaults or inferred values]

**Usage:**
```bash
[Exact command(s)]

Prerequisites:

  • [Collections, binaries, environment needs]

## Done Criteria

This skill execution is complete only when all applicable items are true:

- Trigger decision is explicit (`full-generation`, `snippet-only`, or `docs-only`).
- Required references/templates were consulted for the selected artifact type.
- Generated output has no unresolved placeholders.
- Validation followed default behavior or a documented exception from the matrix.
- Any skipped checks include a concrete reason and deferred command(s).
- Final output includes summary, assumptions, usage, and prerequisites.

© 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

Files

SKILL.md and 58 other files (references, assets) in devops-skills-plugin/skills/ansible-generator of akin-ozer/cc-devops-skills.

  • SKILL.md
  • .gitignore
  • assets/templates/inventory/group_vars/all.yml
  • assets/templates/inventory/group_vars/databases.yml
  • assets/templates/inventory/group_vars/webservers.yml
  • assets/templates/inventory/host_vars/web1.example.com.yml
  • assets/templates/inventory/hosts
  • assets/templates/inventory/hosts.yml
  • assets/templates/playbook/basic_playbook.yml
  • assets/templates/project/.ansible-lint
  • assets/templates/project/ansible.cfg
  • assets/templates/project/requirements.yml
  • assets/templates/role/README.md
  • … and 46 more

Open the folder on GitHubat commit 276af75

Compare with similar skills

Ansible Generator 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.

Ansible Generator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ansible Generator this skillakin-ozer/cc-devops-skills320—~2.3kAutomated safety check: PassApache-2.0
Wdio Testingansible/vscode-ansible488—~2.2kAutomated safety check: PassMIT
Spa Create Configsplunk/splunk-platform-automator138—~3.5kAutomated safety check: PassProprietary
Spa Add Test Scenariosplunk/splunk-platform-automator138—~2.2kAutomated safety check: PassProprietary
Frontend Overlayansible/ansible-ui113—~2.5kAutomated safety check: NotesApache-2.0
Run Testsansible-collections/ansible.mysql134—~1.2kAutomated safety check: PassCustom licence

Similar skills

  • Wdio Testing

    ansible/vscode-ansible

    Write, run, and debug WebDriverIO (WDIO) UI tests for the Ansible VS Code extension.

    488 GitHub stars~2.2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Spa Create Config

    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…

    138 GitHub stars~3.5k tokensUpdated 4 days ago
    DevOps & CloudAuto-check passed
  • Spa Add Test Scenario

    splunk/splunk-platform-automator

    A skill your agent uses when adding app scope/routing test coverage (deployer, CM, DS, direct).

    138 GitHub stars~2.2k tokensUpdated 4 days ago
    DevOps & CloudAuto-check passed
  • Frontend Overlay

    ansible/ansible-ui

    Product-specific frontend wrappers, API clients, and paths for ansible-ui.

    113 GitHub stars~2.5k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • Run Tests

    ansible-collections/ansible.mysql

    Runs and writes tests (sanity, unit, integration) for the ansible.mysql Ansible collection using ansible-test.

    134 GitHub stars~1.2k tokensUpdated 4 days ago
    DevOps & CloudAuto-check passed
  • Ansible Module Doc Review

    ansible-collections/vmware.vmware_rest

    Review and enrich Ansible module documentation to ensure completeness and quality.

    147 GitHub stars~3k tokensUpdated 8 days ago
    DevOps & CloudAuto-check passed

More from akin-ozer/cc-devops-skills

All 30 skills in this repo
  • GitHub Actions Generator

    akin-ozer/cc-devops-skills

    Create, generate, or scaffold GitHub Actions workflows, action.yml, or .github/workflows CI/CD pipelines.

    320 GitHub stars~3.1k tokensUpdated 2 mo ago
    Auto-check passed
  • Helm Generator

    akin-ozer/cc-devops-skills

    Create, scaffold, or generate Helm charts, Chart.yaml, values.yaml, templates, helpers.

    320 GitHub stars~2.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Jenkinsfile Generator

    akin-ozer/cc-devops-skills

    Generate/create/scaffold Jenkinsfile — declarative, scripted, shared library, CI/CD pipelines.

    320 GitHub stars~3.7k tokensUpdated 2 mo ago
    Auto-check passed
  • Dockerfile Validator

    akin-ozer/cc-devops-skills

    Validate, lint, audit, or scan a Dockerfile for security and best practices.

    320 GitHub stars~2.3k tokensUpdated 2 mo ago
    Auto-check passed
  • GitHub Actions Validator

    akin-ozer/cc-devops-skills

    Validate, lint, audit, fix GitHub Actions workflows (.github/workflows).

    320 GitHub stars~4.7k tokensUpdated 2 mo ago
    Auto-check passed
  • Jenkinsfile Validator

    akin-ozer/cc-devops-skills

    Validate, lint, audit, or check Jenkinsfiles and shared libraries.

    320 GitHub stars~2.7k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Categories

Questions about Ansible Generator

What does Ansible Generator do?

Generate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars. Ansible Generator is an agent skill from akin-ozer/cc-devops-skills. Generate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars.

When should I use Ansible Generator?

Ansible Generator fits situations like: tasks that involve Infrastructure as code.

How do I install Ansible Generator in Claude Code?

Run `npx skills add akin-ozer/cc-devops-skills --skill ansible-generator -a claude-code`. Or copy the skill folder (devops-skills-plugin/skills/ansible-generator in akin-ozer/cc-devops-skills) into .claude/skills/ansible-generator in your project. Claude Code loads it when a task matches its description.

How do I install Ansible Generator in Codex?

Run `npx skills add akin-ozer/cc-devops-skills --skill ansible-generator -a codex`. Or copy the skill folder (devops-skills-plugin/skills/ansible-generator in akin-ozer/cc-devops-skills) into .agents/skills/ansible-generator in your project. Codex loads it when a task matches its description.

Can I use Ansible Generator in Cursor, Gemini CLI or GitHub Copilot?

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-generator -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-generator, .gemini/skills/ansible-generator, .github/skills/ansible-generator and .opencode/skills/ansible-generator in your project.

What does Ansible Generator need to run?

SKILL.md names no scripts, command-line tools or credentials: Ansible Generator is instructions for the agent only. Our summary lists: Docker.

Does Ansible Generator access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Ansible Generator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Ansible Generator use?

Ansible Generator 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.

How many tokens does Ansible Generator use?

About 2.3k tokens (SKILL.md is roughly 9.2k 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.

What are the alternatives to Ansible Generator?

Skills that share tags, products or a category with Ansible Generator: Wdio Testing (ansible/vscode-ansible, 488 stars), Spa Create Config (splunk/splunk-platform-automator, 138 stars), Spa Add Test Scenario (splunk/splunk-platform-automator, 138 stars) and Frontend Overlay (ansible/ansible-ui, 113 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ansible Generator?

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.