2016-03-27 18:16:46 +02:00
|
|
|
{# If value is a list, expand it by printing several (key, value) pairs. #}
|
|
|
|
{# Otherwise, just print the (key, value) pair unchanged. #}
|
|
|
|
{% macro expand_list(key, value) -%}
|
2016-03-26 17:54:31 +01:00
|
|
|
{% if value is string or value is number %}
|
|
|
|
{{ key }}: "{{ value }}"
|
|
|
|
{% else %}
|
|
|
|
{% for subvalue in value %}
|
|
|
|
{{ key }}: "{{ subvalue }}"
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2016-03-27 18:16:46 +02:00
|
|
|
{%- endmacro %}
|
|
|
|
# NSD configuration, automatically generated by Ansible.
|
|
|
|
# Do not edit by hand!
|
|
|
|
|
|
|
|
server:
|
|
|
|
{% if nsd_common_config is defined %}
|
|
|
|
# Common configuration
|
|
|
|
{% for key, value in nsd_common_config.iteritems() -%}
|
|
|
|
{{ expand_list(key, value) }}
|
|
|
|
{%- endfor %}
|
2016-03-27 18:06:15 +02:00
|
|
|
{% endif %}
|
2016-03-26 17:54:31 +01:00
|
|
|
|
2016-03-27 18:06:15 +02:00
|
|
|
{% if nsd_local_config is defined %}
|
2016-03-26 17:54:31 +01:00
|
|
|
# Local configuration
|
2016-03-27 18:16:46 +02:00
|
|
|
{% for key, value in nsd_local_config.iteritems() -%}
|
|
|
|
{{ expand_list(key, value) }}
|
|
|
|
{%- endfor %}
|
2016-03-27 18:06:15 +02:00
|
|
|
{% endif %}
|
2016-03-26 17:54:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
# Include zone definitions
|
2016-03-27 17:39:55 +02:00
|
|
|
include: "{{ zones_config_file }}"
|
2016-03-26 17:54:31 +01:00
|
|
|
|