From 8aa9eda27eeff8196dab7c8ec5fe0e6da3e5698d Mon Sep 17 00:00:00 2001 From: SebClem Date: Tue, 13 Jun 2023 19:47:50 +0200 Subject: [PATCH] Fix templating --- plugins/action/load_haproxy_config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/action/load_haproxy_config.py b/plugins/action/load_haproxy_config.py index 6aba3f6..0cf4f89 100644 --- a/plugins/action/load_haproxy_config.py +++ b/plugins/action/load_haproxy_config.py @@ -28,6 +28,7 @@ class ActionModule(ActionBase): if task_vars is None: task_vars = dict() + self.task_var = task_vars self.show_content = True self.included_files = [] @@ -157,6 +158,10 @@ class ActionModule(ActionBase): failed = True err_msg = ('{0} must be stored as a dictionary/hash'.format(to_native(filename))) else: + # Apply Ansible templating to the data + templar = Templar(loader=self._loader, variables=self.task_var) + data = templar.template(data) + self.included_files.append(filename) results.update(data)