mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-11 21:26:44 +00:00
`cli build include` generated one tasks/groups/<group>-roles.yml per invokable category during setup, and the stage plays included those files. They were written by the in-container UID, which is why a dedicated clean-container-owned helper had to delete them from inside the container.
The stage plays now loop over lookup('group_roles', <group>) and include tasks/utils/setup/{group,role}.yml directly. ordered_roles() in utils/roles/order.py holds the run_after topological sort the generator used to perform at build time.
utils/roles/stage.py:_group_names() no longer globs the generated files; it reads get_invokable_paths(), the same categories.yml source those files were derived from.
Measured: handlers still flush after every role (ansible-core 2.20.2, three loop items, three separate handler runs), and resolving all 18 groups costs 0.60s cold against 1.4s for the generator.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Build 🏗️
Build-time generators that materialise role include lists, dependency graphs, and tree visualisations from the role metadata in roles/.
readme
python -m cli.build.readme [roles...] [--override] [--update-cosmos] [--check] generates or completes role README.md files from templates/roles/README.md.j2 (the section schema single source of truth). It derives the ## Cosmos mermaid diagram from meta/services.yml, the ## Quick Setup commands from the role id, and the ## Credits block from meta/main.yml. Prose sections are never rewritten.
- default: add only the managed sections that are missing.
--override: regenerate every managed section in place.--update-cosmos: regenerate only the Cosmos diagram.--check: write nothing; exit non-zero if any README would change.
Make wrappers: make readme-generate [role=<id>] [override=true] [cosmos=true] and make readme-check.