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)