I have this Ansible task:
- name: Build array of Templates
set_fact:
template:
- name: "{{item.name}}"
element1: "{{item.element1}}"
element2: "{{item.element2}}"
with_items: "{{list_of_objects}}"
I don’t know how to add the template object I build in one iteration to an array of templates every time I iterate.
At the end of the task iteration, I want to do something like this (python like):
output = output + [template]