diff --git a/manifests/dns.pp b/manifests/dns.pp index 6ddf6ab..a44648d 100644 --- a/manifests/dns.pp +++ b/manifests/dns.pp @@ -98,10 +98,10 @@ } unless $dns_options == undef { - if is_array($dns_options) { - $used_options = $dns_options.unique.join(',') + $used_options = if $dns_options =~ Array { + $dns_options.unique.join(',') } else { - $used_options = $dns_options + $dns_options } $has_options = $facts['networkmanager_dns'][$_connection]['options'].join(',') diff --git a/manifests/init.pp b/manifests/init.pp index e6cdea5..80b5420 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -149,14 +149,10 @@ } if $enable_global_dns { - if $global_dns_options { - if is_array($global_dns_options) { - $real_dns_options = join($global_dns_options, ',') - } else { - $real_dns_options = $global_dns_options - } - } else { - $real_dns_options = undef + $real_dns_options = $global_dns_options ? { + Array => $global_dns_options.join(','), + String => $global_dns_options, + default => undef, } file { $global_conffile: diff --git a/metadata.json b/metadata.json index 861b5bf..bcef07f 100644 --- a/metadata.json +++ b/metadata.json @@ -6,7 +6,7 @@ "license": "LGPL-3.0-or-later", "source": "https://git.pixelpark.com/puppet/networkmanager.git", "dependencies": [ - { "name": "puppetlabs-stdlib", "version_requirement": ">=7.0.0 <9.0.0" } + { "name": "puppetlabs-stdlib", "version_requirement": ">= 7.0.0 < 10.0.0" } ], "operatingsystem_support": [ {