How can I stop the look inside the jinja template so when it gets the the 
last item it doesn't add a comma at the end breaking the json format. I can 
clearly the very last command on the 5th to last line is whats wrong but I 
can't come up with a solution to this problem. Thanks!

This is my jinja template:

{
   "checks":
      {
{% if elite_receipt_active_domains is defined %}
{% for check in elite_receipt_active_domains %}
    "{{ check.domain }}-cert_check": {
      "command": "/etc/sensu/plugins/check-https-cert.rb --url https://{{ 
check.domain }} --warning 30 --critical 10", 
      "handlers": [
        {{ check.handlers | to_nice_json }}
      ], 
      "interval": {{ ssl_cert_check_interval }}, 
      "standalone": true,
      "subscribers": ["test"]
    },
{% endfor %}
{% for check in elite_receipt_active_domains %}
    "{{ check.domain }}-http_redirect_check": {
      "command": "/etc/sensu/plugins/check-http.rb --url https://{{ 
check.domain }} -s false --response-code 301 --redirect-to https://{{ 
check.domain }} ", 
      "handlers": [
        {{ check.handlers | to_nice_json }}
      ], 
      "interval": {{ http_redirect_checK_interval }}, 
      "standalone": true
    },
{% endfor %}
{% for check in elite_receipt_active_domains %}
    "{{ check.domain }}-https_check": {
      "command": "/etc/sensu/plugins/check-http.rb --url https://{{ 
check.domain }} -s true ", 
      "handlers": [
        {{ check.handlers | to_nice_json }}
      ], 
      "interval": {{ http_check_interval }}, 
      "standalone": true
    },
{% endfor %}
{% endif %}
  }
}


-- 
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/5ada61b1-bc26-451a-8e7a-506117519e94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to