formula-consul/consul/files/services.json
2015-10-10 00:46:19 +03:00

17 lines
492 B
JSON

{% from "consul/map.jinja" import consul with context %}
{
"services": [
{% 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 %}
{% else %}
"{{ key }}": {{ value | json}}{% if not loop.last %},{% endif %}
{% endif %}
{% endfor %}
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}