mirror of
https://github.com/saltstack-formulas/bind-formula.git
synced 2025-04-16 09:40:22 +00:00
Update named.conf.local.jinja
Some reorganization of the format. In the for-loop that handles configured_views: - Add if-block on lines 124-128 to allow specifying a file for your view, rather than defaulting to the name of the specified zone. This allows multiple views to serve the same zone, but use a different file.
This commit is contained in:
parent
522b369cab
commit
d387599e77
1 changed files with 27 additions and 25 deletions
|
@ -7,6 +7,22 @@
|
|||
// organization
|
||||
//include "/etc/bind/zones.rfc1918";
|
||||
|
||||
{% for name, data in salt['pillar.get']('bind:configured_acls', {})|dictsort %}
|
||||
acl {{ name }} {
|
||||
{%- for d in data %}
|
||||
{{ d }};
|
||||
{%- endfor %}
|
||||
};
|
||||
{%- endfor %}
|
||||
|
||||
{%- for name, data in salt['pillar.get']('bind:configured_masters', {})|dictsort %}
|
||||
masters {{ name }} {
|
||||
{%- for d in data %}
|
||||
{{ d }};
|
||||
{%- endfor %}
|
||||
};
|
||||
{%- endfor %}
|
||||
|
||||
{%- macro zone(key, args, file, masters) %}
|
||||
zone "{{ key }}" {
|
||||
type {{ args['type'] }};
|
||||
|
@ -92,21 +108,24 @@ include "{{ map.default_zones_config }}";
|
|||
{{ zone(key, args, file, masters) }}
|
||||
{% endfor %}
|
||||
|
||||
{% for view, view_data in salt['pillar.get']('bind:configured_views', {})|dictsort %}
|
||||
{%- for view, view_data in salt['pillar.get']('bind:configured_views', {})|dictsort %}
|
||||
|
||||
view {{ view }} {
|
||||
{%- if view == 'default' %}
|
||||
include "{{ map.default_zones_config }}";
|
||||
{%- endif %}
|
||||
|
||||
match-clients {
|
||||
match-clients {
|
||||
{%- for acl in view_data.get('match_clients', {}) %}
|
||||
{{ acl }};
|
||||
{%- endfor %}
|
||||
};
|
||||
};
|
||||
|
||||
{% for key, args in view_data.get('configured_zones', {})|dictsort -%}
|
||||
{%- for key, args in view_data.get('configured_zones', {})|dictsort -%}
|
||||
{%- if 'file' in args %}
|
||||
{%- set file = args.file %}
|
||||
{%- else %}
|
||||
{%- set file = salt['pillar.get']("bind:available_zones:" + key + ":file") %}
|
||||
{%- endif %}
|
||||
{%- set masters = salt['pillar.get']("bind:available_zones:" + key + ":masters") %}
|
||||
{{ zone(key, args, file, masters) }}
|
||||
{%- endfor %}
|
||||
|
@ -163,20 +182,3 @@ statistics-channels {
|
|||
{%- endfor %}
|
||||
};
|
||||
{%- endif %}
|
||||
|
||||
|
||||
{%- for name, data in salt['pillar.get']('bind:configured_acls', {})|dictsort %}
|
||||
acl {{ name }} {
|
||||
{%- for d in data %}
|
||||
{{ d }};
|
||||
{%- endfor %}
|
||||
};
|
||||
{%- endfor %}
|
||||
|
||||
{%- for name, data in salt['pillar.get']('bind:configured_masters', {})|dictsort %}
|
||||
masters {{ name }} {
|
||||
{%- for d in data %}
|
||||
{{ d }};
|
||||
{%- endfor %}
|
||||
};
|
||||
{%- endfor %}
|
||||
|
|
Loading…
Add table
Reference in a new issue