ansible-role-init

Scaffold a new Ansible role via ansible-galaxy init.

Updated Nov 12, 2025
One-click install
npx skills add https://github.com/jphetphoumy/skillstack --skill ansible-role-init
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ansible-role-init
Source: https://github.com/jphetphoumy/skillstack/tree/main/skills/ansible-role-init
Command: npx skills add https://github.com/jphetphoumy/skillstack --skill ansible-role-init

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill automates the creation of a standard Ansible role structure using ansible-galaxy init, speeding up project setup.

Core Features & Use Cases

  • Environment check: Verifies that Ansible is installed.
  • Role initialization: Creates a new role with the conventional directory layout.
  • Guidance: Suggests follow-up tasks like metadata updates and task additions.

Quick Start

Say you want a role named webserver. The skill will verify the environment and run: ansible-galaxy init webserver --init-path <dir> (in your target folder) and report back.

Frequently Asked Questions about ansible-role-init

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

FAQPage Schema
How do I scaffold a new Ansible role quickly?

Scaffold an Ansible role by running ansible-galaxy init with your role name and target directory. The skill verifies Ansible is installed, creates the standard directory structure including tasks, handlers, and defaults folders, and reports the role location and next steps for configuration.

What directory structure does ansible-galaxy init create?

Ansible-galaxy init creates a conventional role structure with tasks/main.yml, handlers/main.yml, defaults/main.yml, vars, templates, files, and meta directories. The skill verifies these key files are present and reports their locations after initialization.

Can I use FQCN naming for my Ansible role?

Yes, the skill supports optional Fully Qualified Collection Name (FQCN) naming when creating roles via ansible-galaxy init. It resolves both FQCN and plain role names, validates the identifier, and initializes the role with the correct naming convention.

What happens if the target directory already exists?

The skill handles existing directories by prompting rather than automatically overwriting them. It validates the environment and your input before executing ansible-galaxy init, ensuring you control whether to proceed or choose a different location.

Do I need Ansible installed to create a role?

Yes, the skill performs an environment check to verify Ansible is installed before scaffolding the role. This prerequisite ensures ansible-galaxy init can run successfully to create the standard role structure.

What follow-up tasks does the skill suggest after role creation?

After scaffolding, the skill provides reminders to update role metadata, add tasks to tasks/main.yml, define handlers in handlers/main.yml, and configure default variables in defaults/main.yml to complete your role implementation.