Fix templating

This commit is contained in:
SebClem 2023-06-13 19:47:50 +02:00
parent 753e744d17
commit 8aa9eda27e
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50

View File

@ -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)