mirror of
https://github.com/saltstack-formulas/bind-formula.git
synced 2025-04-16 09:40:22 +00:00
commit
703a5e33a7
10 changed files with 23 additions and 23 deletions
|
@ -202,9 +202,9 @@ bind_rndc_client_config:
|
||||||
|
|
||||||
{%- set views = {False: salt['pillar.get']('bind', {})} %}{# process non-view zones in the same loop #}
|
{%- set views = {False: salt['pillar.get']('bind', {})} %}{# process non-view zones in the same loop #}
|
||||||
{%- do views.update(salt['pillar.get']('bind:configured_views', {})) %}
|
{%- do views.update(salt['pillar.get']('bind:configured_views', {})) %}
|
||||||
{%- for view, view_data in views.items() %}
|
{%- for view, view_data in views|dictsort %}
|
||||||
{%- set dash_view = '-' + view if view else '' %}
|
{%- set dash_view = '-' + view if view else '' %}
|
||||||
{% for zone, zone_data in view_data.get('configured_zones', {}).items() -%}
|
{% for zone, zone_data in view_data.get('configured_zones', {})|dictsort -%}
|
||||||
{%- set file = salt['pillar.get']("bind:available_zones:" + zone + ":file", false) %}
|
{%- set file = salt['pillar.get']("bind:available_zones:" + zone + ":file", false) %}
|
||||||
{%- set zone_records = salt['pillar.get']('bind:available_zones:' + zone + ':records', {}) %}
|
{%- set zone_records = salt['pillar.get']('bind:available_zones:' + zone + ':records', {}) %}
|
||||||
{%- if salt['pillar.get']('bind:available_zones:' + zone + ':generate_reverse') %}
|
{%- if salt['pillar.get']('bind:available_zones:' + zone + ':generate_reverse') %}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// vim:set ts=4 sw=4 et:
|
// vim:set ts=4 sw=4 et:
|
||||||
|
|
||||||
options {
|
options {
|
||||||
directory "{{ named_directory }}";
|
directory "{{ map.get('named_directory') }}";
|
||||||
pid-file "/run/named/named.pid";
|
pid-file "/run/named/named.pid";
|
||||||
|
|
||||||
// Uncomment these to enable IPv6 connections support
|
// Uncomment these to enable IPv6 connections support
|
||||||
|
@ -11,7 +11,7 @@ options {
|
||||||
// listen-on { none; };
|
// listen-on { none; };
|
||||||
|
|
||||||
{#- Allow inclusion of arbitrary statements #}
|
{#- Allow inclusion of arbitrary statements #}
|
||||||
{%- for statement, value in salt['pillar.get']('bind:config:options', {}).items() -%}
|
{%- for statement, value in salt['pillar.get']('bind:config:options', {})|dictsort -%}
|
||||||
{%- if value is iterable and value is not string %}
|
{%- if value is iterable and value is not string %}
|
||||||
{{ statement }} {
|
{{ statement }} {
|
||||||
{%- for item in value %}
|
{%- for item in value %}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
// Do any local configuration here
|
// Do any local configuration here
|
||||||
//
|
//
|
||||||
|
|
||||||
{% for key,args in salt['pillar.get']('bind:keys', {}).items() -%}
|
{% for key,args in salt['pillar.get']('bind:keys', {})|dictsort -%}
|
||||||
key "{{ key }}" {
|
key "{{ key }}" {
|
||||||
algorithm {{ args['algorithm'] | default('HMAC-MD5.SIG-ALG.REG.INT') }};
|
algorithm {{ args['algorithm'] | default('HMAC-MD5.SIG-ALG.REG.INT') }};
|
||||||
secret "{{ args['secret'] }}";
|
secret "{{ args['secret'] }}";
|
||||||
|
|
|
@ -27,7 +27,7 @@ options {
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
{#- Allow inclusion of arbitrary statements #}
|
{#- Allow inclusion of arbitrary statements #}
|
||||||
{%- for statement, value in salt['pillar.get']('bind:config:options', {}).items() -%}
|
{%- for statement, value in salt['pillar.get']('bind:config:options', {})|dictsort -%}
|
||||||
{%- if value is iterable and value is not string %}
|
{%- if value is iterable and value is not string %}
|
||||||
{{ statement }} {
|
{{ statement }} {
|
||||||
{%- for item in value %}
|
{%- for item in value %}
|
||||||
|
|
|
@ -5,13 +5,13 @@ options {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
{% for key,args in salt['pillar.get']('bind:rndc_client:server', {}).items() -%}
|
{% for key,args in salt['pillar.get']('bind:rndc_client:server', {})|dictsort -%}
|
||||||
server "{{ key }}" {
|
server "{{ key }}" {
|
||||||
key {{ args['key'] }};
|
key {{ args['key'] }};
|
||||||
};
|
};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% for key,args in salt['pillar.get']('bind:keys', {}).items() -%}
|
{% for key,args in salt['pillar.get']('bind:keys', {})|dictsort -%}
|
||||||
key "{{ key }}" {
|
key "{{ key }}" {
|
||||||
algorithm {{ args['algorithm'] | default('HMAC-MD5.SIG-ALG.REG.INT') }};
|
algorithm {{ args['algorithm'] | default('HMAC-MD5.SIG-ALG.REG.INT') }};
|
||||||
secret "{{ args['secret'] }}";
|
secret "{{ args['secret'] }}";
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
options {
|
options {
|
||||||
// All file and path names are relative to the chroot directory,
|
// All file and path names are relative to the chroot directory,
|
||||||
// if any, and should be fully qualified.
|
// if any, and should be fully qualified.
|
||||||
directory "{{ named_directory }}";
|
directory "{{ map.get('named_directory') }}";
|
||||||
pid-file "/var/run/named/pid";
|
pid-file "/var/run/named/pid";
|
||||||
dump-file "/var/dump/named_dump.db";
|
dump-file "/var/dump/named_dump.db";
|
||||||
statistics-file "/var/stats/named.stats";
|
statistics-file "/var/stats/named.stats";
|
||||||
|
@ -71,7 +71,7 @@ options {
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
{#- Allow inclusion of arbitrary statements #}
|
{#- Allow inclusion of arbitrary statements #}
|
||||||
{%- for statement, value in salt['pillar.get']('bind:config:options', {}).items() -%}
|
{%- for statement, value in salt['pillar.get']('bind:config:options', {})|dictsort -%}
|
||||||
{%- if value is iterable and value is not string %}
|
{%- if value is iterable and value is not string %}
|
||||||
{{ statement }} {
|
{{ statement }} {
|
||||||
{%- for item in value %}
|
{%- for item in value %}
|
||||||
|
@ -379,7 +379,7 @@ zone "1.168.192.in-addr.arpa" {
|
||||||
|
|
||||||
include "{{ map.local_config }}";
|
include "{{ map.local_config }}";
|
||||||
{%- if 'keys' in salt['pillar.get']('bind') %}
|
{%- if 'keys' in salt['pillar.get']('bind') %}
|
||||||
{% for key,args in salt['pillar.get']('bind:keys', {}).items() -%}
|
{% for key,args in salt['pillar.get']('bind:keys', {})|dictsort -%}
|
||||||
key "{{ key }}" {
|
key "{{ key }}" {
|
||||||
algorithm {{ args['algorithm'] | default('HMAC-MD5.SIG-ALG.REG.INT') }};
|
algorithm {{ args['algorithm'] | default('HMAC-MD5.SIG-ALG.REG.INT') }};
|
||||||
secret "{{ args['secret'] }}";
|
secret "{{ args['secret'] }}";
|
||||||
|
|
|
@ -77,7 +77,7 @@ zone "{{ key }}" {
|
||||||
include "{{ map.default_zones_config }}";
|
include "{{ map.default_zones_config }}";
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{% for key, args in salt['pillar.get']('bind:configured_zones', {}).items() -%}
|
{% for key, args in salt['pillar.get']('bind:configured_zones', {})|dictsort -%}
|
||||||
{%- if salt['pillar.get']("bind:configured_zones:" + key + ":file") -%}
|
{%- if salt['pillar.get']("bind:configured_zones:" + key + ":file") -%}
|
||||||
{%- set file = salt['pillar.get']("bind:configured_zones:" + key + ":file") %}
|
{%- set file = salt['pillar.get']("bind:configured_zones:" + key + ":file") %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -92,7 +92,7 @@ include "{{ map.default_zones_config }}";
|
||||||
{{ zone(key, args, file, masters) }}
|
{{ zone(key, args, file, masters) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% for view, view_data in salt['pillar.get']('bind:configured_views', {}).items() %}
|
{% for view, view_data in salt['pillar.get']('bind:configured_views', {})|dictsort %}
|
||||||
|
|
||||||
view {{ view }} {
|
view {{ view }} {
|
||||||
{%- if view == 'default' %}
|
{%- if view == 'default' %}
|
||||||
|
@ -105,7 +105,7 @@ match-clients {
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
};
|
};
|
||||||
|
|
||||||
{% for key, args in view_data.get('configured_zones', {}).items() -%}
|
{% for key, args in view_data.get('configured_zones', {})|dictsort -%}
|
||||||
{%- set file = salt['pillar.get']("bind:available_zones:" + key + ":file") %}
|
{%- set file = salt['pillar.get']("bind:available_zones:" + key + ":file") %}
|
||||||
{%- set masters = salt['pillar.get']("bind:available_zones:" + key + ":masters") %}
|
{%- set masters = salt['pillar.get']("bind:available_zones:" + key + ":masters") %}
|
||||||
{{ zone(key, args, file, masters) }}
|
{{ zone(key, args, file, masters) }}
|
||||||
|
@ -129,7 +129,7 @@ logging {
|
||||||
|
|
||||||
{%- if salt['pillar.get']('bind:controls', False) %}
|
{%- if salt['pillar.get']('bind:controls', False) %}
|
||||||
controls {
|
controls {
|
||||||
{%- for name, control in salt['pillar.get']('bind:controls').iteritems() if control.get('enabled', True) %}
|
{%- for name, control in salt['pillar.get']('bind:controls')|dictsort if control.get('enabled', True) %}
|
||||||
inet {{ control.get('bind', {}).get('address', '127.0.0.1') }} port {{ control.get('bind', {}).get('port', 953) }}
|
inet {{ control.get('bind', {}).get('address', '127.0.0.1') }} port {{ control.get('bind', {}).get('port', 953) }}
|
||||||
{%- if control.get('allow') %}
|
{%- if control.get('allow') %}
|
||||||
allow {
|
allow {
|
||||||
|
@ -151,7 +151,7 @@ controls {
|
||||||
|
|
||||||
{%- if salt['pillar.get']('bind:statistics', False) %}
|
{%- if salt['pillar.get']('bind:statistics', False) %}
|
||||||
statistics-channels {
|
statistics-channels {
|
||||||
{%- for name, channel in salt['pillar.get']('bind:statistics').iteritems() if channel.get('enabled', True) %}
|
{%- for name, channel in salt['pillar.get']('bind:statistics')|dictsort if channel.get('enabled', True) %}
|
||||||
inet {{ channel.get('bind', {}).get('address', '127.0.0.1') }} port {{ channel.get('bind', {}).get('port', 953) }}
|
inet {{ channel.get('bind', {}).get('address', '127.0.0.1') }} port {{ channel.get('bind', {}).get('port', 953) }}
|
||||||
{%- if channel.get('allow') %}
|
{%- if channel.get('allow') %}
|
||||||
allow {
|
allow {
|
||||||
|
@ -165,7 +165,7 @@ statistics-channels {
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
|
|
||||||
{%- for name, data in salt['pillar.get']('bind:configured_acls', {}).items() %}
|
{%- for name, data in salt['pillar.get']('bind:configured_acls', {})|dictsort %}
|
||||||
acl {{ name }} {
|
acl {{ name }} {
|
||||||
{%- for d in data %}
|
{%- for d in data %}
|
||||||
{{ d }};
|
{{ d }};
|
||||||
|
@ -173,7 +173,7 @@ acl {{ name }} {
|
||||||
};
|
};
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
{%- for name, data in salt['pillar.get']('bind:configured_masters', {}).items() %}
|
{%- for name, data in salt['pillar.get']('bind:configured_masters', {})|dictsort %}
|
||||||
masters {{ name }} {
|
masters {{ name }} {
|
||||||
{%- for d in data %}
|
{%- for d in data %}
|
||||||
{{ d }};
|
{{ d }};
|
||||||
|
|
|
@ -14,7 +14,7 @@ options {
|
||||||
memstatistics-file "{{ map.get('named_directory') }}/data/named_mem_stats.txt";
|
memstatistics-file "{{ map.get('named_directory') }}/data/named_mem_stats.txt";
|
||||||
|
|
||||||
{#- Allow inclusion of arbitrary statements #}
|
{#- Allow inclusion of arbitrary statements #}
|
||||||
{%- for statement, value in salt['pillar.get']('bind:config:options', map.get('options', {})).items() -%}
|
{%- for statement, value in salt['pillar.get']('bind:config:options', map.get('options', {}))|dictsort -%}
|
||||||
{%- if value is iterable and value is not string %}
|
{%- if value is iterable and value is not string %}
|
||||||
{{ statement }} {
|
{{ statement }} {
|
||||||
{%- for item in value %}
|
{%- for item in value %}
|
||||||
|
|
|
@ -18,7 +18,7 @@ options {
|
||||||
|
|
||||||
# The directory statement defines the name server's working directory
|
# The directory statement defines the name server's working directory
|
||||||
|
|
||||||
directory "{{ named_directory }}";
|
directory "{{ map.get('named_directory') }}";
|
||||||
|
|
||||||
# enable DNSSEC validation
|
# enable DNSSEC validation
|
||||||
#
|
#
|
||||||
|
@ -99,7 +99,7 @@ options {
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{#- Allow inclusion of arbitrary statements #}
|
{#- Allow inclusion of arbitrary statements #}
|
||||||
{%- for statement, value in salt['pillar.get']('bind:config:options', map.get('options', {})).items() -%}
|
{%- for statement, value in salt['pillar.get']('bind:config:options', map.get('options', {}))|dictsort -%}
|
||||||
{%- if value is iterable and value is not string %}
|
{%- if value is iterable and value is not string %}
|
||||||
{{ statement }} {
|
{{ statement }} {
|
||||||
{%- for item in value %}
|
{%- for item in value %}
|
||||||
|
|
|
@ -28,11 +28,11 @@ $TTL {{ soa['ttl'] }}
|
||||||
{% if include %}
|
{% if include %}
|
||||||
$INCLUDE {{ include }}
|
$INCLUDE {{ include }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% for type, rrs in records.iteritems() %}
|
{% for type, rrs in records|dictsort %}
|
||||||
;
|
;
|
||||||
; {{ type }} RRs
|
; {{ type }} RRs
|
||||||
;
|
;
|
||||||
{%- for host, data in rrs.iteritems() %}
|
{%- for host, data in rrs|dictsort %}
|
||||||
{%- if data is number or data is string %}
|
{%- if data is number or data is string %}
|
||||||
{{ host }} {{ type }} {{ data }}
|
{{ host }} {{ type }} {{ data }}
|
||||||
{%- elif data is iterable %}
|
{%- elif data is iterable %}
|
||||||
|
|
Loading…
Add table
Reference in a new issue