Files
computer-playbook/utils/roles
kevinveenbirkenbachandClaude Opus 4.8 fc9bb0dd9d refactor(ressources): move resource collection/aggregation to utils (single spot)
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>
2026-06-21 06:03:17 +02:00
..
…
…

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 applications dict and the role config that feeds it.