From c9f29af2b5c9c6a3b52f261d33f0ab17985c1058 Mon Sep 17 00:00:00 2001 From: K Date: Tue, 11 Jul 2017 23:11:10 -0400 Subject: [PATCH] Support list of `masters` in `named.conf.local` template Updates the archlinux, debian, freebsd templates to support passing a list of values to `masters` instead of a string. This is already supported by the redhat template, but lacking in the other 3. --- bind/files/arch/named.conf.local | 10 +++++++++- bind/files/debian/named.conf.local | 10 +++++++++- bind/files/freebsd/named.conf.local | 10 +++++++++- pillar.example | 3 ++- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/bind/files/arch/named.conf.local b/bind/files/arch/named.conf.local index f03024f..a7fb87c 100644 --- a/bind/files/arch/named.conf.local +++ b/bind/files/arch/named.conf.local @@ -35,7 +35,15 @@ zone "{{ key }}" { {%- endif -%} {% else %} notify no; - masters { {{ masters }} }; + {%- if masters is iterable and masters is not string %} + masters { + {%- for item in masters %} + {{ item }}; + {%- endfor %} + }; + {%- else %} + masters { {{ masters }} }; + {%- endif %} {%- endif %} {%- endif %} }; diff --git a/bind/files/debian/named.conf.local b/bind/files/debian/named.conf.local index 5f6ff5a..c8c1321 100644 --- a/bind/files/debian/named.conf.local +++ b/bind/files/debian/named.conf.local @@ -49,7 +49,15 @@ zone "{{ key }}" { {%- endif -%} {% else %} notify no; - masters { {{ masters }} }; + {%- if masters is iterable and masters is not string %} + masters { + {%- for item in masters %} + {{ item }}; + {%- endfor %} + }; + {%- else %} + masters { {{ masters }} }; + {%- endif %} {%- endif %} {%- endif %} }; diff --git a/bind/files/freebsd/named.conf.local b/bind/files/freebsd/named.conf.local index 2e2f8ae..43e9fda 100644 --- a/bind/files/freebsd/named.conf.local +++ b/bind/files/freebsd/named.conf.local @@ -49,7 +49,15 @@ zone "{{ key }}" { {%- endif -%} {% else %} notify no; - masters { {{ masters }} }; + {%- if masters is iterable and masters is not string %} + masters { + {%- for item in masters %} + {{ item }}; + {%- endfor %} + }; + {%- else %} + masters { {{ masters }} }; + {%- endif %} {%- endif %} {%- endif %} }; diff --git a/pillar.example b/pillar.example index 486230b..abe8d31 100644 --- a/pillar.example +++ b/pillar.example @@ -108,4 +108,5 @@ bind: available_zones: sub.domain.org: file: db.sub.domain.org # DB file containing our zone - masters: "192.168.0.1;" # Masters of this zone + masters: # Masters of this zone + - 192.168.0.1