mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-13 06:06:38 +00:00
* add SOFTWARE_DOMAIN derived from SOFTWARE_NAME lowercased * introduce DOMAIN_HOMEPAGE defaulting to dashboard domain if present, otherwise SOFTWARE_DOMAIN * add automatic primary → homepage redirect mapping in constructor * migrate TLS and CA paths from SOFTWARE_NAME|lower to SOFTWARE_DOMAIN * update systemd unit suffix and timer/service discovery globs to SOFTWARE_DOMAIN * switch OIDC default realm and client id to SOFTWARE_DOMAIN * adjust SuiteCRM well-known software name to SOFTWARE_DOMAIN * update unit tests to use SOFTWARE_DOMAIN for strict Jinja expansion https://chatgpt.com/share/698db094-22bc-800f-8454-10d97f817659
Shared Utility Code (module_utils/) for Infinito.Nexus
This directory contains shared Python utility code (also known as "library code") for use by custom Ansible modules, plugins, or roles in the Infinito.Nexus project.
When to Use module_utils
- Shared logic: Use
module_utilsto define functions, classes, or helpers that are shared across multiple custom modules, plugins, or filter/lookups in your project. - Reduce duplication: Centralize code such as API clients, input validation, complex calculations, or protocol helpers.
- Maintainability: If you find yourself repeating code in different custom modules/plugins, refactor it into
module_utils/.
Examples
- Shared HTTP(S) connection handler for multiple modules.
- Common validation or transformation functions for user input.
- Utility functions for interacting with Docker, LDAP, etc.
Usage Example
In a custom Ansible module or plugin:
from module_utils.infinito_utils import my_shared_function
When not to Use module_utils
- Do not place standalone Ansible modules or plugins here—those go into
library/,filter_plugins/, orlookup_plugins/respectively. - Only use for code that will be imported by other plugins or modules.