18 lines
871 B
Markdown
18 lines
871 B
Markdown
|
|
# Scaffold and implement a new Ansible role
|
||
|
|
|
||
|
|
Role name: $ARGUMENTS
|
||
|
|
|
||
|
|
## Steps
|
||
|
|
|
||
|
|
1. Run `make new-role NAME=$ARGUMENTS` to create the directory structure
|
||
|
|
2. Update `roles/$ARGUMENTS/molecule/default/converge.yml` — replace `ROLE_NAME_PLACEHOLDER` with `$ARGUMENTS`
|
||
|
|
3. Fill in `roles/$ARGUMENTS/meta/main.yml` with role metadata (Debian 13 platform)
|
||
|
|
4. Add well-commented placeholder variables to `roles/$ARGUMENTS/defaults/main.yml` using `$ARGUMENTS__varname` namespace
|
||
|
|
5. Write initial tasks in `roles/$ARGUMENTS/tasks/main.yml`:
|
||
|
|
- Use FQCN for all modules
|
||
|
|
- Every task has a descriptive `name:` and at least one tag
|
||
|
|
6. Write `roles/$ARGUMENTS/README.md` with: purpose, variable reference table, example playbook
|
||
|
|
7. Run `make lint` — fix any issues
|
||
|
|
8. Run `make test ROLE=$ARGUMENTS` — fix any failures
|
||
|
|
9. Show a summary of what was created and any open TODOs
|