Skip to content

Commit 703a5e3

Browse files
Merge pull request #110 from bmwiedemann/sort
Two fixes
2 parents a7041da + 7f50076 commit 703a5e3

File tree

10 files changed

+23
-23
lines changed

10 files changed

+23
-23
lines changed

bind/config.sls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ bind_rndc_client_config:
202202
203203
{%- set views = {False: salt['pillar.get']('bind', {})} %}{# process non-view zones in the same loop #}
204204
{%- do views.update(salt['pillar.get']('bind:configured_views', {})) %}
205-
{%- for view, view_data in views.items() %}
205+
{%- for view, view_data in views|dictsort %}
206206
{%- set dash_view = '-' + view if view else '' %}
207-
{% for zone, zone_data in view_data.get('configured_zones', {}).items() -%}
207+
{% for zone, zone_data in view_data.get('configured_zones', {})|dictsort -%}
208208
{%- set file = salt['pillar.get']("bind:available_zones:" + zone + ":file", false) %}
209209
{%- set zone_records = salt['pillar.get']('bind:available_zones:' + zone + ':records', {}) %}
210210
{%- if salt['pillar.get']('bind:available_zones:' + zone + ':generate_reverse') %}

bind/files/arch/named.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// vim:set ts=4 sw=4 et:
22

33
options {
4-
directory "{{ named_directory }}";
4+
directory "{{ map.get('named_directory') }}";
55
pid-file "/run/named/named.pid";
66

77
// Uncomment these to enable IPv6 connections support
@@ -11,7 +11,7 @@ options {
1111
// listen-on { none; };
1212

1313
{#- Allow inclusion of arbitrary statements #}
14-
{%- for statement, value in salt['pillar.get']('bind:config:options', {}).items() -%}
14+
{%- for statement, value in salt['pillar.get']('bind:config:options', {})|dictsort -%}
1515
{%- if value is iterable and value is not string %}
1616
{{ statement }} {
1717
{%- for item in value %}

bind/files/debian/named.conf.key

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do any local configuration here
44
//
55

6-
{% for key,args in salt['pillar.get']('bind:keys', {}).items() -%}
6+
{% for key,args in salt['pillar.get']('bind:keys', {})|dictsort -%}
77
key "{{ key }}" {
88
algorithm {{ args['algorithm'] | default('HMAC-MD5.SIG-ALG.REG.INT') }};
99
secret "{{ args['secret'] }}";

bind/files/debian/named.conf.options

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ options {
2727
{%- endif -%}
2828

2929
{#- Allow inclusion of arbitrary statements #}
30-
{%- for statement, value in salt['pillar.get']('bind:config:options', {}).items() -%}
30+
{%- for statement, value in salt['pillar.get']('bind:config:options', {})|dictsort -%}
3131
{%- if value is iterable and value is not string %}
3232
{{ statement }} {
3333
{%- for item in value %}

bind/files/debian/rndc.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ options {
55
};
66

77

8-
{% for key,args in salt['pillar.get']('bind:rndc_client:server', {}).items() -%}
8+
{% for key,args in salt['pillar.get']('bind:rndc_client:server', {})|dictsort -%}
99
server "{{ key }}" {
1010
key {{ args['key'] }};
1111
};
1212
{% endfor %}
1313

14-
{% for key,args in salt['pillar.get']('bind:keys', {}).items() -%}
14+
{% for key,args in salt['pillar.get']('bind:keys', {})|dictsort -%}
1515
key "{{ key }}" {
1616
algorithm {{ args['algorithm'] | default('HMAC-MD5.SIG-ALG.REG.INT') }};
1717
secret "{{ args['secret'] }}";

bind/files/freebsd/named.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
options {
1212
// All file and path names are relative to the chroot directory,
1313
// if any, and should be fully qualified.
14-
directory "{{ named_directory }}";
14+
directory "{{ map.get('named_directory') }}";
1515
pid-file "/var/run/named/pid";
1616
dump-file "/var/dump/named_dump.db";
1717
statistics-file "/var/stats/named.stats";
@@ -71,7 +71,7 @@ options {
7171
{%- endif -%}
7272

7373
{#- Allow inclusion of arbitrary statements #}
74-
{%- for statement, value in salt['pillar.get']('bind:config:options', {}).items() -%}
74+
{%- for statement, value in salt['pillar.get']('bind:config:options', {})|dictsort -%}
7575
{%- if value is iterable and value is not string %}
7676
{{ statement }} {
7777
{%- for item in value %}
@@ -379,7 +379,7 @@ zone "1.168.192.in-addr.arpa" {
379379

380380
include "{{ map.local_config }}";
381381
{%- if 'keys' in salt['pillar.get']('bind') %}
382-
{% for key,args in salt['pillar.get']('bind:keys', {}).items() -%}
382+
{% for key,args in salt['pillar.get']('bind:keys', {})|dictsort -%}
383383
key "{{ key }}" {
384384
algorithm {{ args['algorithm'] | default('HMAC-MD5.SIG-ALG.REG.INT') }};
385385
secret "{{ args['secret'] }}";

bind/files/named.conf.local.jinja

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ zone "{{ key }}" {
7777
include "{{ map.default_zones_config }}";
7878
{%- endif %}
7979

80-
{% for key, args in salt['pillar.get']('bind:configured_zones', {}).items() -%}
80+
{% for key, args in salt['pillar.get']('bind:configured_zones', {})|dictsort -%}
8181
{%- if salt['pillar.get']("bind:configured_zones:" + key + ":file") -%}
8282
{%- set file = salt['pillar.get']("bind:configured_zones:" + key + ":file") %}
8383
{% else %}
@@ -92,7 +92,7 @@ include "{{ map.default_zones_config }}";
9292
{{ zone(key, args, file, masters) }}
9393
{% endfor %}
9494

95-
{% for view, view_data in salt['pillar.get']('bind:configured_views', {}).items() %}
95+
{% for view, view_data in salt['pillar.get']('bind:configured_views', {})|dictsort %}
9696

9797
view {{ view }} {
9898
{%- if view == 'default' %}
@@ -105,7 +105,7 @@ match-clients {
105105
{%- endfor %}
106106
};
107107

108-
{% for key, args in view_data.get('configured_zones', {}).items() -%}
108+
{% for key, args in view_data.get('configured_zones', {})|dictsort -%}
109109
{%- set file = salt['pillar.get']("bind:available_zones:" + key + ":file") %}
110110
{%- set masters = salt['pillar.get']("bind:available_zones:" + key + ":masters") %}
111111
{{ zone(key, args, file, masters) }}
@@ -129,7 +129,7 @@ logging {
129129

130130
{%- if salt['pillar.get']('bind:controls', False) %}
131131
controls {
132-
{%- for name, control in salt['pillar.get']('bind:controls').iteritems() if control.get('enabled', True) %}
132+
{%- for name, control in salt['pillar.get']('bind:controls')|dictsort if control.get('enabled', True) %}
133133
inet {{ control.get('bind', {}).get('address', '127.0.0.1') }} port {{ control.get('bind', {}).get('port', 953) }}
134134
{%- if control.get('allow') %}
135135
allow {
@@ -151,7 +151,7 @@ controls {
151151

152152
{%- if salt['pillar.get']('bind:statistics', False) %}
153153
statistics-channels {
154-
{%- for name, channel in salt['pillar.get']('bind:statistics').iteritems() if channel.get('enabled', True) %}
154+
{%- for name, channel in salt['pillar.get']('bind:statistics')|dictsort if channel.get('enabled', True) %}
155155
inet {{ channel.get('bind', {}).get('address', '127.0.0.1') }} port {{ channel.get('bind', {}).get('port', 953) }}
156156
{%- if channel.get('allow') %}
157157
allow {
@@ -165,15 +165,15 @@ statistics-channels {
165165
{%- endif %}
166166

167167

168-
{%- for name, data in salt['pillar.get']('bind:configured_acls', {}).items() %}
168+
{%- for name, data in salt['pillar.get']('bind:configured_acls', {})|dictsort %}
169169
acl {{ name }} {
170170
{%- for d in data %}
171171
{{ d }};
172172
{%- endfor %}
173173
};
174174
{%- endfor %}
175175

176-
{%- for name, data in salt['pillar.get']('bind:configured_masters', {}).items() %}
176+
{%- for name, data in salt['pillar.get']('bind:configured_masters', {})|dictsort %}
177177
masters {{ name }} {
178178
{%- for d in data %}
179179
{{ d }};

bind/files/redhat/named.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ options {
1414
memstatistics-file "{{ map.get('named_directory') }}/data/named_mem_stats.txt";
1515

1616
{#- Allow inclusion of arbitrary statements #}
17-
{%- for statement, value in salt['pillar.get']('bind:config:options', map.get('options', {})).items() -%}
17+
{%- for statement, value in salt['pillar.get']('bind:config:options', map.get('options', {}))|dictsort -%}
1818
{%- if value is iterable and value is not string %}
1919
{{ statement }} {
2020
{%- for item in value %}

bind/files/suse/named.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ options {
1818

1919
# The directory statement defines the name server's working directory
2020

21-
directory "{{ named_directory }}";
21+
directory "{{ map.get('named_directory') }}";
2222

2323
# enable DNSSEC validation
2424
#
@@ -99,7 +99,7 @@ options {
9999
{% endif %}
100100

101101
{#- Allow inclusion of arbitrary statements #}
102-
{%- for statement, value in salt['pillar.get']('bind:config:options', map.get('options', {})).items() -%}
102+
{%- for statement, value in salt['pillar.get']('bind:config:options', map.get('options', {}))|dictsort -%}
103103
{%- if value is iterable and value is not string %}
104104
{{ statement }} {
105105
{%- for item in value %}

bind/files/zone.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ $TTL {{ soa['ttl'] }}
2828
{% if include %}
2929
$INCLUDE {{ include }}
3030
{% else %}
31-
{% for type, rrs in records.iteritems() %}
31+
{% for type, rrs in records|dictsort %}
3232
;
3333
; {{ type }} RRs
3434
;
35-
{%- for host, data in rrs.iteritems() %}
35+
{%- for host, data in rrs|dictsort %}
3636
{%- if data is number or data is string %}
3737
{{ host }} {{ type }} {{ data }}
3838
{%- elif data is iterable %}

0 commit comments

Comments
 (0)