Merge pull request #67 from imran1008/arch-allow-transfer

Arch: support allow-transfer
This commit is contained in:
Forrest 2016-11-07 09:05:41 -08:00 committed by GitHub
commit 275140e3fb

View file

@ -1,3 +1,4 @@
# vim: sts=2 ts=2 sw=2 et ai
// //
// Do any local configuration here // Do any local configuration here
// //
@ -6,9 +7,7 @@
// organization // organization
//include "/etc/bind/zones.rfc1918"; //include "/etc/bind/zones.rfc1918";
{% for key,args in salt['pillar.get']('bind:configured_zones', {}).items() -%} {%- macro zone(key, args, file, masters) %}
{%- set file = salt['pillar.get']("bind:available_zones:" + key + ":file") %}
{%- set masters = salt['pillar.get']("bind:available_zones:" + key + ":masters") %}
zone "{{ key }}" { zone "{{ key }}" {
type {{ args['type'] }}; type {{ args['type'] }};
{% if args['type'] == 'forward' -%} {% if args['type'] == 'forward' -%}
@ -22,19 +21,29 @@ zone "{{ key }}" {
}; };
{% else -%} {% else -%}
file "{{ file }}"; file "{{ file }}";
{%- if args['allow-transfer'] is defined %}
allow-transfer { {{ args.get('allow-transfer', []) | join('; ') }}; };
{%- endif %}
{%- if args['also-notify'] is defined %} {%- if args['also-notify'] is defined %}
also-notify { {{ args.get('also-notify', []) | join('; ') }}; }; also-notify { {{ args.get('also-notify', []) | join('; ') }}; };
{%- endif %} {%- endif %}
{% if args['type'] == "master" -%} {%- if args['type'] == "master" -%}
{% if args['notify'] -%} {% if args['notify'] %}
notify yes; notify yes;
{% else -%} {% else %}
notify no; notify no;
{%- endif -%} {%- endif -%}
{% else -%} {% else %}
notify no; notify no;
masters { {{ masters }} }; masters { {{ masters }} };
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}
}; };
{%- endmacro %}
{% for key, args in salt['pillar.get']('bind:configured_zones', {}).items() -%}
{%- set file = salt['pillar.get']("bind:available_zones:" + key + ":file") %}
{%- set masters = salt['pillar.get']("bind:available_zones:" + key + ":masters") %}
{{ zone(key, args, file, masters) }}
{% endfor %} {% endfor %}