From 1cfb77cc2f1ea8194f0d78a8822e9e491d6a8a4b Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 28 Oct 2023 12:11:22 +0900 Subject: [PATCH] Add support for also_notifies pool option Change-Id: Ie5ffc921694d8ae083e79d3ee04852ff38b2d459 --- manifests/backend/bind9.pp | 6 ++++++ manifests/backend/pdns4.pp | 6 ++++++ releasenotes/notes/also_notifies-6256fec3da406f5e.yaml | 6 ++++++ templates/bind9-pools.yaml.erb | 7 +++++++ templates/pdns4-pools.yaml.erb | 7 +++++++ 5 files changed, 32 insertions(+) create mode 100644 releasenotes/notes/also_notifies-6256fec3da406f5e.yaml diff --git a/manifests/backend/bind9.pp b/manifests/backend/bind9.pp index 2bd4dfb8..9b9e7d3b 100644 --- a/manifests/backend/bind9.pp +++ b/manifests/backend/bind9.pp @@ -45,6 +45,11 @@ # (Optional) TCP Port to connect to designate-mdns service. # Defaults to 5354. # +# [*also_notifies*] +# (Optional) Array of hosts for which designate-mdns will send DNS notify +# packets to. +# Defaults to []. +# # [*configure_bind*] # (Optional) Enables running bind9/named configuration for hosts where # designate and designate bind services are collocated. @@ -65,6 +70,7 @@ class designate::backend::bind9 ( $dns_port = 53, Array[String[1]] $mdns_hosts = ['127.0.0.1'], $mdns_port = 5354, + Array[String[1]] $also_notifies = [], Boolean $configure_bind = true, Boolean $manage_pool = true, ) { diff --git a/manifests/backend/pdns4.pp b/manifests/backend/pdns4.pp index 39a8c00b..b719d15a 100644 --- a/manifests/backend/pdns4.pp +++ b/manifests/backend/pdns4.pp @@ -32,6 +32,11 @@ # (Optional) Name of TSIGKey. # Defaults to undef. # +# [*also_notifies*] +# (Optional) Array of hosts for which designate-mdns will send DNS notify +# packets to. +# Defaults to []. +# # [*manage_pool*] # (Optional) Manage pools.yaml and update pools by designate-manage command # Defaults to true @@ -44,6 +49,7 @@ class designate::backend::pdns4 ( $mdns_port = 5354, String[1] $api_endpoint = 'http://127.0.0.1:8081', Optional[String[1]] $tsigkey_name = undef, + Array[String[1]] $also_notifies = [], Boolean $manage_pool = true, ) { diff --git a/releasenotes/notes/also_notifies-6256fec3da406f5e.yaml b/releasenotes/notes/also_notifies-6256fec3da406f5e.yaml new file mode 100644 index 00000000..c6d09ca5 --- /dev/null +++ b/releasenotes/notes/also_notifies-6256fec3da406f5e.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + The ``designate::backend::bind9`` class and + the ``designate::backend::pdns4`` class now supports the ``also_notifies`` + parameter. diff --git a/templates/bind9-pools.yaml.erb b/templates/bind9-pools.yaml.erb index 585fd0ad..08758bf2 100644 --- a/templates/bind9-pools.yaml.erb +++ b/templates/bind9-pools.yaml.erb @@ -34,3 +34,10 @@ rndc_config_file: <%= @rndc_config_file %> rndc_key_file: <%= @rndc_key_file %> <% end -%> +<% if !(@also_notifies.empty?) -%> + also_notifies: +<% @also_notifies.each do |also_notify| -%> + - host: <%= also_notify %> + port: <%= @dns_port.to_s %> +<% end -%> +<% end -%> diff --git a/templates/pdns4-pools.yaml.erb b/templates/pdns4-pools.yaml.erb index 3cfa0bf5..c5fb10c1 100644 --- a/templates/pdns4-pools.yaml.erb +++ b/templates/pdns4-pools.yaml.erb @@ -23,3 +23,10 @@ tsigkey_name: <%= @tsigkey_name %> <%- end -%> <% end -%> +<% if !(@also_notifies.empty?) -%> + also_notifies: +<% @also_notifies.each do |also_notify| -%> + - host: <%= also_notify %> + port: <%= @dns_port.to_s %> +<% end -%> +<% end -%>