From c44804cb6a30a15aa9a101c250f64c0303190d67 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Fri, 28 Oct 2022 15:07:03 -0700 Subject: [PATCH] feat(named.conf.local.jinja): Allow "allow-update" to have multiple elements This allows to have multiple keys or a mix of keys and IP ... --- bind/files/named.conf.local.jinja | 7 ++++++- pillar.example | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bind/files/named.conf.local.jinja b/bind/files/named.conf.local.jinja index 1176c1f5..9264d0af 100644 --- a/bind/files/named.conf.local.jinja +++ b/bind/files/named.conf.local.jinja @@ -46,7 +46,12 @@ zone "{{ key }}" { inline-signing yes; {%- endif %} {%- if args['allow-update'] is defined %} - allow-update { {{ args['allow-update'] }}; }; + {%- if args['allow-update'] is string %} + {%- set allow_update = [args['allow-update']] %} + {%- else %} + {%- set allow_update = args['allow-update'] %} + {%- endif %} + allow-update { {{ allow_update | join('; ') }}; }; {%- endif %} {%- if args.update_policy is defined %} update-policy { diff --git a/pillar.example b/pillar.example index 4f292070..4de01922 100644 --- a/pillar.example +++ b/pillar.example @@ -261,7 +261,9 @@ bind: dynamic.domain.com: # Our ddns zone type: master # As above - allow-update: "key core_dhcp" # Who we allow updates from (refers to above key) + allow-update: + - "key core_dhcp" # Who we allow updates, could be a string or an array + - "key other_dhcp" notify: true # Notify NS RRs of changes sub.anotherdomain.com: # Another domain zone