From 22e466f8bbf27b5718e2f1c29e887beb54fb9040 Mon Sep 17 00:00:00 2001 From: Andre timmermann Date: Thu, 5 Oct 2023 10:43:25 +0200 Subject: [PATCH 1/2] Allow Stdlib 9.x --- manifests/init.pp | 31 +++++++++++-------------------- metadata.json | 2 +- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index b51b697..5bcece5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -6,25 +6,16 @@ String $certname = $::fqdn, Variant[Enum['true', 'false'], Boolean] $run_every_thirty = true, #lint:ignore:quoted_booleans Variant[Enum['true', 'false'], Boolean] $run_in_noop = true, #lint:ignore:quoted_booleans - String $cron_command = '/opt/puppetlabs/bin/puppet agent --onetime --no-daemonize --no-usecacheonfailure --detailed-exitcodes --no-splay', + Sttring $cron_command = '/opt/puppetlabs/bin/puppet agent --onetime --no-daemonize --no-usecacheonfailure --detailed-exitcodes --no-splay', Variant[Enum['true', 'false'], Boolean] $run_at_boot = true, #lint:ignore:quoted_booleans - String $config_path = '/etc/puppetlabs/puppet/puppet.conf', + Stdlib::Absolutepath $config_path = '/etc/puppetlabs/puppet/puppet.conf', String $server = 'puppet', String $ca_server = 'puppet', String $env = $environment, Variant[Enum['true', 'false'], Boolean] $graph = false, #lint:ignore:quoted_booleans - String $agent_sysconfig_path = '/etc/sysconfig/puppet', + Stdlib::Absolutepath $agent_sysconfig_path = '/etc/sysconfig/puppet', Hash $custom_settings = {}, ) { - - if $config_path != undef { - validate_absolute_path($config_path) - } - - if $agent_sysconfig_path != undef { - validate_absolute_path($agent_sysconfig_path) - } - if is_string($run_every_thirty) == true { $run_every_thirty_bool = str2bool($run_every_thirty) } else { @@ -46,7 +37,7 @@ if $run_every_thirty_bool == true { $cron_run_one = fqdn_rand(30) $cron_run_two = fqdn_rand(30) + 30 - $cron_minute = [ $cron_run_one, $cron_run_two] + $cron_minute = [$cron_run_one, $cron_run_two] $cron_ensure = 'present' } else { $cron_ensure = 'absent' @@ -82,18 +73,18 @@ $ini_defaults = { ensure => 'present', - path => $::puppet::config_path, + path => $puppet::config_path, section => 'main', require => File['puppet_config'], } $ini_settings = { - 'server' => { setting => 'server', value => $server,}, - 'ca_server' => { setting => 'ca_server', value => $ca_server,}, - 'certname' => { setting => 'certname', value => $certname,}, - 'environment' => { setting => 'environment', value => $env,}, - 'trusted_node_data' => { setting => 'trusted_node_data', value => true,}, - 'graph' => { setting => 'graph', value => $graph,}, + 'server' => { setting => 'server', value => $server, }, + 'ca_server' => { setting => 'ca_server', value => $ca_server, }, + 'certname' => { setting => 'certname', value => $certname, }, + 'environment' => { setting => 'environment', value => $env, }, + 'trusted_node_data' => { setting => 'trusted_node_data', value => true, }, + 'graph' => { setting => 'graph', value => $graph, }, } create_resources('ini_setting', $ini_settings, $ini_defaults) create_resources('ini_setting', $custom_settings, $ini_defaults) diff --git a/metadata.json b/metadata.json index d6134dd..2b9aa50 100644 --- a/metadata.json +++ b/metadata.json @@ -43,6 +43,6 @@ "dependencies": [ {"name":"puppetlabs/cron_core","version_requirement":">= 1.0.0 <2.0.0"}, {"name":"puppetlabs/inifile","version_requirement":">= 1.6.0 < 2.0.0"}, - {"name":"puppetlabs/stdlib","version_requirement":">= 4.6.0 < 6.0.0"} + {"name":"puppetlabs/stdlib","version_requirement":">= 4.6.0 < 10.0.0"} ] } From 4f7b92aec4199221508c05fa8c5d0a87f83a4c63 Mon Sep 17 00:00:00 2001 From: Andre timmermann Date: Thu, 5 Oct 2023 10:46:12 +0200 Subject: [PATCH 2/2] typo --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 5bcece5..f97b916 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -6,7 +6,7 @@ String $certname = $::fqdn, Variant[Enum['true', 'false'], Boolean] $run_every_thirty = true, #lint:ignore:quoted_booleans Variant[Enum['true', 'false'], Boolean] $run_in_noop = true, #lint:ignore:quoted_booleans - Sttring $cron_command = '/opt/puppetlabs/bin/puppet agent --onetime --no-daemonize --no-usecacheonfailure --detailed-exitcodes --no-splay', + String $cron_command = '/opt/puppetlabs/bin/puppet agent --onetime --no-daemonize --no-usecacheonfailure --detailed-exitcodes --no-splay', Variant[Enum['true', 'false'], Boolean] $run_at_boot = true, #lint:ignore:quoted_booleans Stdlib::Absolutepath $config_path = '/etc/puppetlabs/puppet/puppet.conf', String $server = 'puppet',