I want this output ingress = ["aa","bb"]
- name: Create the Jinja2 based template
template:
src: "/var/opt/conf.yml.j2"
dest: "/var/opt/conf.yml"
with_items: "{{ var }}"
ingress = [{% for item in var.stdout_lines %} "{{ item }}", {% endfor %}]
But I get this with a ,
at the end of the list
ingress = ["aa","bb",]
How could I trim the last character ,
{% for item in var.stdout_lines %} "{{ item }}" {%if not loop.last %},{% endif %}{% endfor %}