formula-consul/consul/files/services.json

17 lines
492 B
JSON
Raw Normal View History

2015-10-09 17:39:53 -04:00
{% from "consul/map.jinja" import consul with context %}
{
"services": [
2015-10-09 17:46:19 -04:00
{% for service in consul.register %}
2015-10-09 17:39:53 -04:00
{
{% 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 %}
]
}