mirror of
https://github.com/saltstack-formulas/bind-formula.git
synced 2025-04-16 17:50:23 +00:00
Merge pull request #61 from 0xf10e/master
iteritems() -> items(), fixes saltstack-formulas/bind-formula#30
This commit is contained in:
commit
7b7b705603
10 changed files with 20 additions and 13 deletions
|
@ -24,6 +24,10 @@ Install the bind package and start the bind service.
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
Manage the bind configuration file.
|
Manage the bind configuration file.
|
||||||
|
Zone files are not generated by this state
|
||||||
|
rather than taken from `salt://zones`.
|
||||||
|
See `pillar.example` for how to overwrite
|
||||||
|
this URL.
|
||||||
|
|
||||||
Example Pillar
|
Example Pillar
|
||||||
==============
|
==============
|
||||||
|
|
|
@ -130,7 +130,7 @@ bind_default_zones:
|
||||||
map: {{ map }}
|
map: {{ map }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% for zone, zone_data in salt['pillar.get']('bind:configured_zones', {}).iteritems() -%}
|
{% for zone, zone_data in salt['pillar.get']('bind:configured_zones', {}).items() -%}
|
||||||
{%- set file = salt['pillar.get']("bind:available_zones:" + zone + ":file") %}
|
{%- set file = salt['pillar.get']("bind:available_zones:" + zone + ":file") %}
|
||||||
{% if file and zone_data['type'] == "master" -%}
|
{% if file and zone_data['type'] == "master" -%}
|
||||||
zones-{{ zone }}:
|
zones-{{ zone }}:
|
||||||
|
@ -157,8 +157,8 @@ signed-{{ zone }}:
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{%- for view, view_data in salt['pillar.get']('bind:configured_views', {}).iteritems() %}
|
{%- for view, view_data in salt['pillar.get']('bind:configured_views', {}).items() %}
|
||||||
{% for zone, zone_data in view_data.get('configured_zones', {}).iteritems() -%}
|
{% for zone, zone_data in view_data.get('configured_zones', {}).items() -%}
|
||||||
{%- set file = salt['pillar.get']("bind:available_zones:" + zone + ":file") %}
|
{%- set file = salt['pillar.get']("bind:available_zones:" + zone + ":file") %}
|
||||||
{% if file and zone_data['type'] == "master" -%}
|
{% if file and zone_data['type'] == "master" -%}
|
||||||
zones-{{ view }}-{{ zone }}:
|
zones-{{ view }}-{{ zone }}:
|
||||||
|
|
|
@ -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', {}).iteritems() -%}
|
{%- for statement, value in salt['pillar.get']('bind:config:options', {}).items() -%}
|
||||||
{%- 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 %}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
// organization
|
// organization
|
||||||
//include "/etc/bind/zones.rfc1918";
|
//include "/etc/bind/zones.rfc1918";
|
||||||
|
|
||||||
{% for key,args in salt['pillar.get']('bind:configured_zones', {}).iteritems() -%}
|
{% for key,args in salt['pillar.get']('bind:configured_zones', {}).items() -%}
|
||||||
{%- 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 }}" {
|
zone "{{ key }}" {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
// Do any local configuration here
|
// Do any local configuration here
|
||||||
//
|
//
|
||||||
|
|
||||||
{% for key,args in salt['pillar.get']('bind:keys', {}).iteritems() -%}
|
{% for key,args in salt['pillar.get']('bind:keys', {}).items() -%}
|
||||||
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'] }}";
|
||||||
|
|
|
@ -60,13 +60,13 @@ zone "{{ key }}" {
|
||||||
include "{{ map.default_zones_config }}";
|
include "{{ map.default_zones_config }}";
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{% for key, args in salt['pillar.get']('bind:configured_zones', {}).iteritems() -%}
|
{% for key, args in salt['pillar.get']('bind:configured_zones', {}).items() -%}
|
||||||
{%- 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) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% for view, view_data in salt['pillar.get']('bind:configured_views', {}).iteritems() %}
|
{% for view, view_data in salt['pillar.get']('bind:configured_views', {}).items() %}
|
||||||
|
|
||||||
view {{ view }} {
|
view {{ view }} {
|
||||||
{%- if view == 'default' %}
|
{%- if view == 'default' %}
|
||||||
|
@ -79,7 +79,7 @@ match-clients {
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
};
|
};
|
||||||
|
|
||||||
{% for key, args in view_data.get('configured_zones', {}).iteritems() -%}
|
{% for key, args in view_data.get('configured_zones', {}).items() -%}
|
||||||
{%- 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) }}
|
||||||
|
|
|
@ -21,7 +21,7 @@ options {
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
{#- Allow inclusion of arbitrary statements #}
|
{#- Allow inclusion of arbitrary statements #}
|
||||||
{%- for statement, value in salt['pillar.get']('bind:config:options', {}).iteritems() -%}
|
{%- for statement, value in salt['pillar.get']('bind:config:options', {}).items() -%}
|
||||||
{%- 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 %}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
// organization
|
// organization
|
||||||
//include "/etc/bind/zones.rfc1918";
|
//include "/etc/bind/zones.rfc1918";
|
||||||
|
|
||||||
{% for key,args in salt['pillar.get']('bind:configured_zones', {}).iteritems() -%}
|
{% for key,args in salt['pillar.get']('bind:configured_zones', {}).items() -%}
|
||||||
{%- 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 }}" {
|
zone "{{ key }}" {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
'pkgs': ['bind9', 'bind9utils', 'dnssec-tools'],
|
'pkgs': ['bind9', 'bind9utils', 'dnssec-tools'],
|
||||||
'service': 'bind9',
|
'service': 'bind9',
|
||||||
'config_source_dir': 'bind/files/debian',
|
'config_source_dir': 'bind/files/debian',
|
||||||
'zones_source_dir': '/srv/salt/zones',
|
'zones_source_dir': 'zones',
|
||||||
'config': '/etc/bind/named.conf',
|
'config': '/etc/bind/named.conf',
|
||||||
'local_config': '/etc/bind/named.conf.local',
|
'local_config': '/etc/bind/named.conf.local',
|
||||||
'key_config': '/etc/bind/named.conf.key',
|
'key_config': '/etc/bind/named.conf.key',
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
'pkgs': ['bind'],
|
'pkgs': ['bind'],
|
||||||
'service': 'named',
|
'service': 'named',
|
||||||
'config_source_dir': 'bind/files/redhat',
|
'config_source_dir': 'bind/files/redhat',
|
||||||
'zones_source_dir': '/srv/salt/zones',
|
'zones_source_dir': 'zones',
|
||||||
'config': '/etc/named.conf',
|
'config': '/etc/named.conf',
|
||||||
'local_config': '/etc/named.conf.local',
|
'local_config': '/etc/named.conf.local',
|
||||||
'default_config': '/etc/sysconfig/named',
|
'default_config': '/etc/sysconfig/named',
|
||||||
|
|
|
@ -3,6 +3,9 @@ bind:
|
||||||
pkgs:
|
pkgs:
|
||||||
- bind
|
- bind
|
||||||
service: named
|
service: named
|
||||||
|
# take zonefiles from `salt://bind/zonedata`
|
||||||
|
# instead of `salt://zones`:
|
||||||
|
zones_source_dir: bind/zonedata
|
||||||
|
|
||||||
bind:
|
bind:
|
||||||
config:
|
config:
|
||||||
|
|
Loading…
Add table
Reference in a new issue