mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-13 14:16:46 +00:00
- Move get_docker_paths() implementation from filter_plugins to module_utils to make it reusable by filters and lookup plugins (single source of truth) - Adapt filter_plugins/get_docker_paths.py to re-export the shared util - Add new lookup plugin "database" resolving DB settings from applications config - Fix unit test patching: patch module_utils.docker_paths_utils.get_entity_name instead of filter module, because imports are now bound at util level - Add comprehensive unit tests for database lookup covering all helper-variable cases https://chatgpt.com/share/6983b526-00dc-800f-b3a0-b71e4104d0fc
Custom Filter Plugins for Infinito.Nexus
This directory contains custom Ansible filter plugins used within the Infinito.Nexus project.
When to Use a Filter Plugin
- Transform values: Use filters to transform, extract, reformat, or compute values from existing variables or facts.
- Inline data manipulation: Filters are designed for inline use in Jinja2 expressions (in templates, tasks, vars, etc.).
- No external lookups: Filters only operate on data you explicitly pass to them and cannot access external files, the Ansible inventory, or runtime context.
Examples
{{ role_name | get_entity_name }}
{{ my_list | unique }}
{{ user_email | regex_replace('^(.+)@.*$', '\\1') }}
When not to Use a Filter Plugin
- If you need to load data from an external source (e.g., file, environment, API), use a lookup plugin instead.
- If your logic requires access to inventory, facts, or host-level information that is not passed as a parameter.