mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-09 12:17:13 +00:00
Move the parse/collect/aggregate logic out of the ressources CLI into utils/roles/applications/services/resources.py so the CLI and the upcoming variant resource-budget guard share one implementation instead of duplicating it. The CLI's query/__main__ and the unit tests now import from utils; the per-module CLI files (parse.py, collect.py, aggregate.py) are removed. No behavior change: the 43 ressources unit tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Role Utilities 🧩
Helpers under utils/roles/ operate on Ansible role artefacts and the dictionaries that mirror them at runtime.
Scope 📋
Modules in utils/roles/ MUST stay focused on data that originates from roles/<role>/ (meta/services.yml, meta/main.yml, vars/, defaults/) or the runtime dictionary that mirrors those files (applications).
Modules in utils/roles/ MUST NOT depend on Ansible plugin loader internals at import time so the same code can be imported from filter plugins, lookup plugins, library modules, the CLI, and tests.
Subpackages 📦
- applications/ helpers around the central
applicationsdict and the role config that feeds it.