Hi,
I have the bellow vars to populate a template , it works almost fine but the final file result you can see there is some indentation problem :
vars :
datadog_http_checks:
- name : mycheck
url : http://localhost:9090/hc/
threshold : 5
window : 5
timeout : 1
template:
init_config:
instances:
{% for http in datadog_http_checks %}
- name: {{ http.name }}
{% if http.url is defined -%}
url: {{ http.url }}
{% endif -%}
{% if http.threshold is defined -%}
threshold: {{ http.threshold }}
{% endif %}
{% if http.window is defined -%}
window: {{ http.window }}
{% endif %}
{% if http.timeout is defined -%}
timeout: {{ http.timeout }}
{% endif %}
{% if http.include_content is defined -%}
include_content: {{ http.include_content }}
{% endif %}
notify: - pagerduty
{% endfor %}
result :
instances:
- name: mycheck
url: http://localhost:9090/hc/
threshold: 5
window: 5
timeout: 1
notify: - pagerduty
Is this a bug or am I doing something wrong ?