new-rolelisted
Install: claude install-skill 3A2DEV/ansible-designer
# new-role
Scaffold a complete Ansible role following the standard directory structure and production conventions.
---
## Required Inputs
Collect these parameters (one at a time, using discovery context for defaults):
1. **role_name** — The role name (e.g., `nginx`, `postgres`, `ntp`)
2. **location** — One of:
- **role_path**: Directory to create the role in (e.g., `./roles/`, default from discovery `roles_path`)
- **FQCN**: `namespace.collection.role` (e.g., `myorg.infra.nginx`) → creates role inside the collection
3. **multi_os** — MANDATORY question: "Does this role need multi-OS support? (RHEL / Solaris / Windows/WinRM) [yes/no]"
4. **description** — Brief role description for meta/main.yml
---
## FQCN Resolution
When the user provides a FQCN (`namespace.collection.role`):
1. Look in `./collections/ansible_collections/<namespace>/<collection>/roles/`
2. Also check `collections_path` entries from ansible.cfg
3. If the collection exists: create the role inside it
4. If the collection does not exist: warn and ask if the user wants to use `/ansible-designer:new-collection` first, or create the role standalone
---
## Multi-OS Question (MANDATORY)
Always ask this question — never skip it:
```
Does this role need multi-OS support?
1. No — single platform (Linux/RHEL only)
2. Yes — RHEL + Solaris + Windows/WinRM
Enter 1 or 2:
```
**If single-platform (option 1):** Generate standard role structure without OS var files.
**If multi-OS (option 2):** Generate: