From 63c49d743180411963e02eb1e98bfb695345fcef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bahad=C4=B1r=20Kandemir?= Date: Sat, 10 Oct 2015 00:58:08 +0300 Subject: [PATCH] Deep scan config --- consul/files/services.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/consul/files/services.json b/consul/files/services.json index 4ee6075..d40bd01 100644 --- a/consul/files/services.json +++ b/consul/files/services.json @@ -4,8 +4,16 @@ {% for service in consul.register %} { {% for key, value in service.items() %} - {% if key == 'script' %} - "{{ script }}": "/opt/consul/scripts/"{{ value.split('/')[-1] }}{% if not loop.last %},{% endif %} + {% if key == 'checks' %} + "checks": [ + {% for key2, value2 in value.items() %} + {% if key2 == 'script' %} + "script": /opt/consul/scripts/{{ value2.split('/')[-1] }}{% if not loop.last %},{% endif %} + {% else %} + "{{ key2 }}": {{ value2 | json}}{% if not loop.last %},{% endif %} + {% endif %} + {% endfor %} + ]{% if not loop.last %},{% endif %} {% else %} "{{ key }}": {{ value | json}}{% if not loop.last %},{% endif %} {% endif %}