From b06d4143da17db2177394c7d73fbaf329e1025b6 Mon Sep 17 00:00:00 2001 From: SebClem Date: Mon, 16 Sep 2024 19:12:32 +0200 Subject: [PATCH] Stuff --- .../{get_all_site.py => load_caddy_relay_config.py} | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) rename plugins/action/{get_all_site.py => load_caddy_relay_config.py} (96%) diff --git a/plugins/action/get_all_site.py b/plugins/action/load_caddy_relay_config.py similarity index 96% rename from plugins/action/get_all_site.py rename to plugins/action/load_caddy_relay_config.py index 317f48d..aa59dfc 100644 --- a/plugins/action/get_all_site.py +++ b/plugins/action/load_caddy_relay_config.py @@ -42,6 +42,9 @@ class ActionModule(ActionBase): raise AnsibleError('\'dir\' option is mendatory in load_hasites_config') if not "default_domain" in module_args: raise AnsibleError('\'default_domain\' option is mendatory in load_hasites_config') + if not "target" in module_args: + raise AnsibleError('\'target\' option is mendatory in load_hasites_config') + self.source_dir = module_args.get('dir') self.default_domain = module_args.get('default_domain') @@ -68,9 +71,14 @@ class ActionModule(ActionBase): break results['sites'] = results['sites'] + updated_results['sites'] - + result = { + "relay_conf": { + "sites": result["site"], + "target": module_args['target'] + } + } result = super(ActionModule, self).run(task_vars=task_vars) - + if failed: result['failed'] = failed result['message'] = err_msg