16 lines
500 B
JSON
16 lines
500 B
JSON
{% from "consul/map.jinja" import consul with context %}
|
|
{
|
|
"services": [
|
|
{% for service in consul.register.items() %}
|
|
{
|
|
{% 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 %}
|
|
]
|
|
}
|