module_utils package

Subpackages

Submodules

module_utils.cert_utils module

class module_utils.cert_utils.CertUtils

Bases: object

classmethod build_snapshot(cert_base_path)
classmethod ensure_cert_mapping(cert_base_path, debug=False)
static extract_sans(cert_text)
classmethod find_cert_for_domain(domain, cert_base_path, debug=False)
static list_cert_files(cert_base_path)
static matches(domain, san)

RFC compliant SAN matching.

classmethod refresh_cert_mapping(cert_base_path, debug=False)

Build mapping: SAN -> list of entries entry = {

‘folder’: str, ‘cert_path’: str, ‘mtime’: float, ‘not_before’: int|None, ‘not_after’: int|None, ‘is_wildcard’: bool

}

static run_openssl(cert_path)
static run_openssl_dates(cert_path)

Returns (not_before_ts, not_after_ts) as POSIX timestamps or (None, None) on failure.

classmethod snapshot_changed(cert_base_path)

module_utils.config_utils module

class module_utils.config_utils.AnsibleUndefined

Bases: object

exception module_utils.config_utils.AppConfigKeyError(message: str = '', obj: Any = None, show_content: bool = True, suppress_extended_error: bool | EllipsisType = Ellipsis, orig_exc: BaseException | None = None, help_text: str | None = None)

Bases: AnsibleTemplatePluginError, ValueError

Raised when a required application config key is missing (strict mode). Compatible with Ansible error handling and Python ValueError.

exception module_utils.config_utils.ConfigEntryNotSetError(message: str = '', obj: Any = None, show_content: bool = True, suppress_extended_error: bool | EllipsisType = Ellipsis, orig_exc: BaseException | None = None, help_text: str | None = None)

Bases: AppConfigKeyError

Raised when a config entry is defined in schema but not set in application.

module_utils.config_utils.get_app_conf(applications, application_id, config_path, strict=True, default=None, skip_missing_app=False)

module_utils.dict_renderer module

class module_utils.dict_renderer.DictRenderer(verbose: bool = False, timeout: float = 10.0)

Bases: object

Resolves placeholders in the form << path >> within nested dictionaries, supporting hyphens, numeric list indexing, and quoted keys via [‘key’] or [“key”].

PATTERN = re.compile('<<\\s*(?P<path>[^\\s>]+)\\s*>>')
TOKEN_REGEX = re.compile('(?P<key>[\\w\\-]+)|\\[\'(?P<qkey>[^\']+)\'\\]|\\[\\"(?P<dkey>[^\\"]+)\\"\\]|\\[(?P<idx>\\d+)\\]')
find_unresolved(data: Any) Set[str]

Return all paths of unresolved << placeholders in data.

render(data: Dict[str, Any] | List[Any]) Dict[str, Any] | List[Any]

module_utils.domain_utils module

module_utils.domain_utils.get_domain(domains, application_id)
Return the domain for application_id from the domains mapping:
  • If value is a string, return it.

  • If value is a dict, return its first value.

  • If value is a list, return its first element.

  • Otherwise, raise an error.

module_utils.entity_name_utils module

module_utils.entity_name_utils.flatten_categories(tree, prefix='')

Flattens nested category tree to all possible category paths.

module_utils.entity_name_utils.get_entity_name(role_name)

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

module_utils.entity_name_utils.load_categories_tree(categories_file)

module_utils.get_url module

module_utils.get_url.get_url(domains, application_id, protocol)

module_utils.role_dependency_resolver module

class module_utils.role_dependency_resolver.RoleDependencyResolver(roles_dir: str)

Bases: object

get_role_dependencies(role_name: str, *, resolve_include_role: bool = True, resolve_import_role: bool = True, resolve_dependencies: bool = True, resolve_run_after: bool = False) Set[str]
resolve_transitively(start_roles: Iterable[str], *, resolve_include_role: bool = True, resolve_import_role: bool = True, resolve_dependencies: bool = True, resolve_run_after: bool = False, max_depth: int | None = None) Set[str]

module_utils.sounds module

class module_utils.sounds.DummySound

Bases: object

static play_finished_failed_sound() None
static play_finished_successfully_sound() None
static play_infinito_intro_sound() None
static play_start_sound() None
static play_warning_sound() None
module_utils.sounds.Sound

alias of DummySound

module_utils.valid_deploy_id module

Utility for validating deployment application IDs against defined roles and inventory.

class module_utils.valid_deploy_id.ValidDeployId(roles_dir='roles')

Bases: object

validate(inventory_path, ids)

Validate a list of application IDs against both role definitions and inventory. Returns a dict mapping invalid IDs to their presence status. .. rubric:: Example

{

“app1”: {“in_roles”: False, “in_inventory”: True}, “app2”: {“in_roles”: True, “in_inventory”: False}

}

Module contents