diff --git a/manifests/init.pp b/manifests/init.pp index 0d38038c..ae9bf06c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -65,11 +65,11 @@ # # @param dns_stub_listener # Takes a boolean argument or one of "udp" and "tcp". -# Setting it to `'absent'` will remove `DNSStubListener` existing entries from the configuration file- +# Setting it to `'absent'` will remove `DNSStubListener` existing entries from the configuration file # # @param dns_stub_listener_extra # Additional addresses for the DNS stub listener to listen on -# Setting it to `['absent']` will remove `DNSStubListenerExtra` existing entries from the configuration file- +# Setting it to `'absent'` will remove `DNSStubListenerExtra` existing entries from the configuration file # # @param manage_resolv_conf # For when `manage_resolved` is `true` should the file `/etc/resolv.conf` be managed. @@ -206,8 +206,8 @@ Optional[Variant[Boolean,Enum['allow-downgrade']]] $dnssec = undef, Variant[Boolean,Enum['yes', 'opportunistic', 'no']] $dnsovertls = false, Optional[Variant[Boolean,Enum['no-negative']]] $cache = undef, - Optional[Variant[Boolean,Enum['udp','tcp','absent']]] $dns_stub_listener = undef, - Optional[Array[String[1]]] $dns_stub_listener_extra = undef, + Optional[Variant[Boolean,Enum['udp','tcp','absent']]] $dns_stub_listener = undef, + Optional[Variant[Array[String[1]],Enum['absent']]] $dns_stub_listener_extra = undef, Boolean $manage_resolv_conf = true, Boolean $use_stub_resolver = false, Boolean $manage_networkd = false, diff --git a/manifests/resolved.pp b/manifests/resolved.pp index ac23df6a..4ad60ce8 100644 --- a/manifests/resolved.pp +++ b/manifests/resolved.pp @@ -59,7 +59,7 @@ Optional[Variant[Boolean,Enum['yes', 'opportunistic', 'no']]] $dnsovertls = $systemd::dnsovertls, Optional[Variant[Boolean,Enum['no-negative']]] $cache = $systemd::cache, Optional[Variant[Boolean,Enum['udp', 'tcp','absent']]] $dns_stub_listener = $systemd::dns_stub_listener, - Optional[Array[String[1]]] $dns_stub_listener_extra = $systemd::dns_stub_listener_extra, + Optional[Variant[Array[String[1]],Enum['absent']]] $dns_stub_listener_extra = $systemd::dns_stub_listener_extra, Boolean $use_stub_resolver = $systemd::use_stub_resolver, ) { assert_private() @@ -252,7 +252,7 @@ if $dns_stub_listener_extra =~ NotUndef { ini_setting { 'dns_stub_listener_extra': - ensure => stdlib::ensure($dns_stub_listener_extra[0] != 'absent'), + ensure => stdlib::ensure($dns_stub_listener_extra != 'absent'), value => $dns_stub_listener_extra, setting => 'DNSStubListenerExtra', section => 'Resolve', diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 8082c070..ec5df670 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -158,7 +158,7 @@ manage_resolved: true, dns: ['8.8.8.8', '8.8.4.4'], fallback_dns: ['2001:4860:4860::8888', '2001:4860:4860::8844'], - dns_stub_listener_extra: ['absent'] + dns_stub_listener_extra: 'absent' } end