From bcbf423a4a789054ccb8319345219700ba0236dc Mon Sep 17 00:00:00 2001 From: SebClem Date: Mon, 16 Sep 2024 18:51:53 +0200 Subject: [PATCH] Add target var --- plugins/action/load_caddy_config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/action/load_caddy_config.py b/plugins/action/load_caddy_config.py index aa4c800..4bcdecc 100644 --- a/plugins/action/load_caddy_config.py +++ b/plugins/action/load_caddy_config.py @@ -91,7 +91,10 @@ class ActionModule(ActionBase): scope['caddy_config'] = results results = scope result['ansible_included_var_files'] = self.included_files - result['ansible_facts'] = results + if not "target_var" in module_args: + result['ansible_facts'] = results + else: + result['ansible_facts'][module_args['target_var']] = results result['_ansible_no_log'] = not self.show_content return result