mirror of
https://github.com/saltstack-formulas/bind-formula.git
synced 2025-04-17 02:00:23 +00:00
Copied part of functionality from debian conf.local
This commit is contained in:
parent
1cf371921c
commit
8d93eabd86
1 changed files with 50 additions and 8 deletions
|
@ -6,9 +6,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' -%}
|
||||||
|
@ -21,20 +19,64 @@ zone "{{ key }}" {
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
};
|
};
|
||||||
{% else -%}
|
{% else -%}
|
||||||
file "data/{{ file }}";
|
{% if args['dnssec'] is defined and args['dnssec'] -%}
|
||||||
|
file "{{ map.named_directory }}/{{ file }}.signed";
|
||||||
|
{% else -%}
|
||||||
|
file "{{ map.named_directory }}/{{ file }}";
|
||||||
|
{%- endif %}
|
||||||
|
{%- if args['allow-update'] is defined %}
|
||||||
|
allow-update { {{args['allow-update']}}; };
|
||||||
|
{%- endif %}
|
||||||
|
{%- if args.update_policy is defined %}
|
||||||
|
update-policy {
|
||||||
|
{%- for policy in args.update_policy %}
|
||||||
|
{{ policy }};
|
||||||
|
{%- endfor %}
|
||||||
|
};
|
||||||
|
{%- endif %}
|
||||||
|
{%- 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'] == 'slave' %}
|
||||||
{% if args['notify'] -%}
|
{%- if args['allow-notify'] is defined %}
|
||||||
|
allow-notify { {{ args.get('allow-notify', []) | join('; ') }}; };
|
||||||
|
{%- endif %}
|
||||||
|
{%- endif %}
|
||||||
|
{%- if args['type'] == "master" -%}
|
||||||
|
{% if args['notify'] %}
|
||||||
notify yes;
|
notify yes;
|
||||||
{% else -%}
|
{% else %}
|
||||||
notify no;
|
notify no;
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{% else -%}
|
{% else %}
|
||||||
notify no;
|
notify no;
|
||||||
|
{%- if masters is iterable and masters is not string %}
|
||||||
|
masters {
|
||||||
|
{%- for item in masters %}
|
||||||
|
{{ item }};
|
||||||
|
{%- endfor %}
|
||||||
|
};
|
||||||
|
{%- else %}
|
||||||
masters { {{ masters }} };
|
masters { {{ masters }} };
|
||||||
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
};
|
};
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
|
{% for key, args in salt['pillar.get']('bind:configured_zones', {}).items() -%}
|
||||||
|
{%- set file = args.get('file', salt['pillar.get']("bind:available_zones:" + key + ":file")) %}
|
||||||
|
{%- set masters = args.get('masters', salt['pillar.get']("bind:available_zones:" + key + ":masters")) %}
|
||||||
|
{{ zone(key, args, file, masters) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
{%- for name, data in salt['pillar.get']('bind:configured_acls', {}).items() %}
|
||||||
|
acl {{ name }} {
|
||||||
|
{%- for d in data %}
|
||||||
|
{{ d }};
|
||||||
|
{%- endfor %}
|
||||||
|
};
|
||||||
|
{%- endfor %}
|
||||||
|
|
Loading…
Add table
Reference in a new issue