diff --git a/manifests/backend/bind9.pp b/manifests/backend/bind9.pp index 6319eb57..fc345065 100644 --- a/manifests/backend/bind9.pp +++ b/manifests/backend/bind9.pp @@ -54,6 +54,10 @@ # packets to. # Defaults to []. # +# [*attributes*] +# (Optional) Pool attribtes used by scheduling. +# Defaults to {} +# # DEPRECATED PARAMETERS # # [*configure_bind*] @@ -66,21 +70,22 @@ # Defaults to true # class designate::backend::bind9 ( - $rndc_config_file = '/etc/rndc.conf', - $rndc_key_file = '/etc/rndc.key', - $rndc_controls = undef, - $rndc_port = 953, - Hash[Integer, String] $ns_records = {1 => 'ns1.example.org.'}, - Array[String[1], 1] $nameservers = ['127.0.0.1'], - Array[String[1], 1] $bind9_hosts = ['127.0.0.1'], - $dns_port = 53, - Array[String[1], 1] $mdns_hosts = ['127.0.0.1'], - $mdns_port = 5354, - Boolean $clean_zonefile = false, - Array[String[1]] $also_notifies = [], + $rndc_config_file = '/etc/rndc.conf', + $rndc_key_file = '/etc/rndc.key', + $rndc_controls = undef, + $rndc_port = 953, + Hash[Integer, String] $ns_records = {1 => 'ns1.example.org.'}, + Array[String[1], 1] $nameservers = ['127.0.0.1'], + Array[String[1], 1] $bind9_hosts = ['127.0.0.1'], + $dns_port = 53, + Array[String[1], 1] $mdns_hosts = ['127.0.0.1'], + $mdns_port = 5354, + Boolean $clean_zonefile = false, + Array[String[1]] $also_notifies = [], + Hash[String[1], String[1]] $attributes = {}, # DEPRECATED PARAMETERS - Boolean $configure_bind = true, - Boolean $manage_pool = true, + Boolean $configure_bind = true, + Boolean $manage_pool = true, ) { include designate::deps diff --git a/manifests/backend/pdns4.pp b/manifests/backend/pdns4.pp index 2824ebe3..0ee397e6 100644 --- a/manifests/backend/pdns4.pp +++ b/manifests/backend/pdns4.pp @@ -37,6 +37,10 @@ # packets to. # Defaults to []. # +# [*attributes*] +# (Optional) Pool attribtes used by scheduling. +# Defaults to {} +# # DEPRECATED PARAMETERS # # [*manage_pool*] @@ -45,15 +49,16 @@ # class designate::backend::pdns4 ( String[1] $api_token, - Array[String[1], 1] $pdns4_hosts = ['127.0.0.1'], - $pdns4_port = 53, - Array[String[1], 1] $mdns_hosts = ['127.0.0.1'], - $mdns_port = 5354, - String[1] $api_endpoint = 'http://127.0.0.1:8081', - Optional[String[1]] $tsigkey_name = undef, - Array[String[1]] $also_notifies = [], + Array[String[1], 1] $pdns4_hosts = ['127.0.0.1'], + $pdns4_port = 53, + Array[String[1], 1] $mdns_hosts = ['127.0.0.1'], + $mdns_port = 5354, + String[1] $api_endpoint = 'http://127.0.0.1:8081', + Optional[String[1]] $tsigkey_name = undef, + Array[String[1]] $also_notifies = [], + Hash[String[1], String[1]] $attributes = {}, # DEPRECATED PARAMETERS - Boolean $manage_pool = true, + Boolean $manage_pool = true, ) { include designate::deps diff --git a/releasenotes/notes/pool-attributes-c26c27a695d8f480.yaml b/releasenotes/notes/pool-attributes-c26c27a695d8f480.yaml new file mode 100644 index 00000000..e88d8fa6 --- /dev/null +++ b/releasenotes/notes/pool-attributes-c26c27a695d8f480.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + The ``attributes`` parameter has been added to the following classes. + + - ``designate::backend::bind9`` + - ``designate::backend::pdns4`` diff --git a/templates/bind9-pools.yaml.erb b/templates/bind9-pools.yaml.erb index ab0eb04a..d38a3008 100644 --- a/templates/bind9-pools.yaml.erb +++ b/templates/bind9-pools.yaml.erb @@ -1,7 +1,14 @@ --- - name: default description: Default pool +<% if @attributes.empty? -%> attributes: {} +<% else -%> + attributes: +<% @attributes.sort.each do |key, val| -%> + <%= key %>: <%= val %> +<% end -%> +<% end -%> ns_records: <% @ns_records.sort.each do |priority, hostname| -%> diff --git a/templates/pdns4-pools.yaml.erb b/templates/pdns4-pools.yaml.erb index c5fb10c1..88e5fdc4 100644 --- a/templates/pdns4-pools.yaml.erb +++ b/templates/pdns4-pools.yaml.erb @@ -1,7 +1,14 @@ --- - name: default description: Default pool +<% if @attributes.empty? -%> attributes: {} +<% else -%> + attributes: +<% @attributes.sort.each do |key, val| -%> + <%= key %>: <%= val %> +<% end -%> +<% end -%> targets: <% @pdns4_hosts.each do |pdns4_host| -%>