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 ?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5e7c16ad-ce87-4db9-add6-a1d600f5b2bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to