ansible-role-init

Scaffold a new Ansible role via ansible-galaxy init

16 stars

Best use case

ansible-role-init is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Scaffold a new Ansible role via ansible-galaxy init

Teams using ansible-role-init should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ansible-role-init/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/devops/ansible-role-init/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ansible-role-init/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ansible-role-init Compares

Feature / Agentansible-role-initStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Scaffold a new Ansible role via ansible-galaxy init

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

You are an Ansible role scaffold assistant. Follow this workflow whenever the user wants a new role created with `ansible-galaxy init`.

Workflow:

1. Collect details:
   - Confirm the desired role name (e.g., `webserver`).
   - Confirm the target directory; default to the current project root unless the user specifies another absolute/relative path.
   - Ask whether the user wants a fully qualified collection name (FQCN) such as `acme.webserver`; if not provided, use the plain role name.
2. Validate the environment:
   - Run `ansible-galaxy --version` to confirm Ansible is installed; if missing, stop and instruct the user to install Ansible.
   - If the target role directory already exists, pause and ask whether to overwrite/skip; never delete files automatically.
3. Initialize the role:
   - From the target parent directory run `ansible-galaxy init <role_identifier>` where `<role_identifier>` is the FQCN or role name collected earlier. Example:
     ```
     ansible-galaxy init acme.webserver --init-path roles
     ```
   - Use `--init-path <dir>` when the user wants the role created inside a specific subdirectory; otherwise run the command inside the desired parent folder.
4. Verify success:
   - Check that the generated role folder exists and contains the standard structure (`tasks/main.yml`, `handlers/main.yml`, `defaults/main.yml`, etc.).
   - If files were created, summarize the location and list any follow-up reminders (e.g., update `meta/main.yml`, add tasks).
5. Report back:
   - Provide the role path, the command executed, and any manual next steps the user should complete.
   - If the command failed, include the exact error output and suggestions for resolution.

Related Skills

assume-cloudformation-role

16
from diegosouzapw/awesome-omni-skill

Assume AWS IAM role for CloudFormation operations and set temporary credentials as environment variables. Use when working with CloudFormation stacks or when authentication setup is needed before AWS CloudFormation operations.

ansible

16
from diegosouzapw/awesome-omni-skill

Provides comprehensive guidance for Ansible automation including playbooks, roles, inventory, and module usage. Use when the user asks about Ansible, needs to automate IT tasks, create Ansible playbooks, or manage infrastructure with Ansible.

ansible-workflow

16
from diegosouzapw/awesome-omni-skill

Ansible automation workflow guidelines. Activate when working with Ansible playbooks, ansible-playbook, inventory files (.yml, .ini), or Ansible-specific patterns.

ansible-validator

16
from diegosouzapw/awesome-omni-skill

Comprehensive toolkit for validating, linting, testing, and automating Ansible playbooks, roles, and collections. Use this skill when working with Ansible files (.yml, .yaml playbooks, roles, inventories), validating automation code, debugging playbook execution, performing dry-run testing with check mode, or working with custom modules and collections.

ansible-testinfra

16
from diegosouzapw/awesome-omni-skill

Bootstrap minimal testinfra pytest suite for an Ansible role and remind to run via uv

ansible-roles

16
from diegosouzapw/awesome-omni-skill

Use when structuring and reusing code with Ansible roles for modular, maintainable automation and configuration management.

ansible-playbooks

16
from diegosouzapw/awesome-omni-skill

Use when writing and organizing Ansible playbooks for automated configuration management and infrastructure orchestration.

ansible-playbook

16
from diegosouzapw/awesome-omni-skill

Write and review Ansible playbooks following best practices. Use when the user says "write ansible", "ansible playbook", "review playbook", "automate with ansible", or asks to configure servers with Ansible.

ansible-inventory

16
from diegosouzapw/awesome-omni-skill

Use when managing hosts and groups in Ansible inventory for organizing infrastructure and applying configurations across environments.

ansible-host-limiter

16
from diegosouzapw/awesome-omni-skill

Ensures ansible and ansible-playbook commands always include the -l (limit) flag to target only ndelucca-server and prevent accidental execution on raspberry-printer or other hosts. Activate this skill whenever running any ansible or ansible-playbook commands.

ansible-fix

16
from diegosouzapw/awesome-omni-skill

ALWAYS use this skill immediately after running 'ansible-galaxy init' to create a new Ansible role. Also use when the user asks to fix ansible-lint errors or when ansible-lint output shows fixable issues like yaml[comments], schema[meta], meta-incorrect, name[play], or role-name[path] violations.

ansible-expert

16
from diegosouzapw/awesome-omni-skill

Expert-level Ansible for configuration management, automation, and infrastructure as code