utils.roles.entity packageΒΆ

SubmodulesΒΆ

utils.roles.entity.apps moduleΒΆ

Reverse entity -> application_id resolver.

utils.roles.entity.name.get_entity_name maps a role / application_id to its compose entity name (the longest matching category prefix stripped). The purge orchestrators need the inverse: given an entity name, which application_ids belong to it? This helper walks the roles directory and returns that mapping.

Used by utils.cleanup.nginx_vhosts so an entity-keyed purge can enumerate the per-app domains whose nginx vhost files belong to the stack being torn down.

utils.roles.entity.apps.apps_for_entity(entity: str, *, roles_dir: Path) β†’ list[str]ΒΆ

Return sorted, deduplicated application_ids whose role belongs to entity under get_entity_name.

Returns an empty list when entity is blank, roles_dir is not a directory, or no role matches.

utils.roles.entity.name moduleΒΆ

utils.roles.entity.name.get_entity_name(role_name)ΒΆ

Get the entity name from a role name by removing the longest matching category path from categories.yml.

Module contentsΒΆ