Added auto setting for redirect urls for keycloak clients. Element and Synapse still need to be mapped

This commit is contained in:
2025-08-11 00:17:18 +02:00
parent 0746acedfd
commit 6e8ae793e3
17 changed files with 436 additions and 56 deletions

18
module_utils/get_url.py Normal file
View File

@@ -0,0 +1,18 @@
from ansible.errors import AnsibleFilterError
import sys, os
def get_url(domains, application_id, protocol):
plugin_dir = os.path.dirname(__file__)
project_root = os.path.dirname(plugin_dir)
module_utils = os.path.join(project_root, 'module_utils')
if module_utils not in sys.path:
sys.path.append(module_utils)
try:
from domain_utils import get_domain
except ImportError as e:
raise AnsibleFilterError(f"could not import domain_utils: {e}")
if not isinstance(protocol, str):
raise AnsibleFilterError("Protocol must be a string")
return f"{protocol}://{ get_domain(domains, application_id) }"