Files
computer-playbook/module_utils
kevinveenbirkenbach 66d50e2dde feat(inventory): resolve shared providers transitively and support schema-less roles
- Allow credentials generator to run for roles without schema/main.yml so
  transitive config-based generation still works.
- Make InventoryManager resilient to missing YAML by defaulting to {} and
  only loading schema when schema/main.yml exists.
- Add recursive shared-provider include resolution based on docker.services
  config and apply provider schemas/special rules transitively.
- Require database_password injection only when database.enabled=true and shared=true.
- Update unit/integration tests to create required files for .exists() checks and
  validate transitive provider role credential generation.

https://chatgpt.com/share/69639d93-4c10-800f-bc6c-8e5b9fb75088
2026-01-11 13:54:37 +01:00
..
2025-12-17 16:37:21 +01:00
2025-12-17 16:37:21 +01:00
2025-12-17 16:37:21 +01:00
2025-12-17 16:37:21 +01:00
2025-12-17 16:37:21 +01:00
2025-12-17 16:37:21 +01:00
2025-12-18 14:33:54 +01:00
2025-12-18 14:33:54 +01:00

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_utils to 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 ansible.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/, or lookup_plugins/ respectively.
  • Only use for code that will be imported by other plugins or modules.

Further Reading