interface={{ slap_configuration.get('tun-name', '') }}
port=5353

{%- set filtered_slave_instance_list = [] %}
{%- for slave_instance in slap_configuration.get('slave-instance-list', []) %}
{%-   if slave_instance.get('_', '') != '' %}
{%-     set slave = json_module.loads(slave_instance.pop('_')) %}
{%-   else %}
{%-     set slave = slave_instance %}
{%-   endif %}
{%-   if slave.get('subdomain', '') != '' %}
{%-     do filtered_slave_instance_list.append(slave) %}
{%-   endif %}
{%- endfor %}

{% for i, slave in enumerate(filtered_slave_instance_list) -%}
address=/{{ slave['subdomain'] }}.{{ slap_configuration.get('local_domain', '') }}/{{ slave.get('ip', '') }}
{% endfor -%}