diff --git a/manifests/run.pp b/manifests/run.pp index b42ac6d..7cf2608 100644 --- a/manifests/run.pp +++ b/manifests/run.pp @@ -5,8 +5,10 @@ if ($facts['os']['family'] == 'windows') { $command = "${::env_windows_installdir}\\bin\\puppet" + $logdest = 'eventlog' } else { $command = '/opt/puppetlabs/puppet/bin/puppet' + $logdest = 'syslog' } # PUP-1391 Puppet 5.4.0 does not require '--user=root'. @@ -16,7 +18,7 @@ $user = '--user=root' } - $arguments = "device ${user} --waitforcert=0 --verbose" + $arguments = "device ${user} --waitforcert=0 --verbose --logdest ${logdest}" # PUP-7412 Puppet 5.0.0 introduces '--target='. $targetable = (versioncmp($::puppetversion, '5.0.0') >= 0) diff --git a/spec/defines/init_spec.rb b/spec/defines/init_spec.rb index 588cf4e..9819980 100644 --- a/spec/defines/init_spec.rb +++ b/spec/defines/init_spec.rb @@ -105,7 +105,7 @@ it { is_expected.to contain_device_manager__run__via_cron__device(title) } it { is_expected.to contain_cron('run puppet device').with( - 'command' => '/opt/puppetlabs/puppet/bin/puppet device --user=root --waitforcert=0 --verbose', + 'command' => '/opt/puppetlabs/puppet/bin/puppet device --user=root --waitforcert=0 --verbose --logdest syslog', ) } end @@ -137,7 +137,7 @@ it { is_expected.to contain_device_manager__run__via_cron__device(title) } it { is_expected.to contain_cron("run puppet device target #{title}").with( - 'command' => "/opt/puppetlabs/puppet/bin/puppet device --user=root --waitforcert=0 --verbose --target=#{title}", + 'command' => "/opt/puppetlabs/puppet/bin/puppet device --user=root --waitforcert=0 --verbose --logdest syslog --target=#{title}", 'hour' => '*', ) } @@ -172,7 +172,8 @@ it { is_expected.to contain_device_manager__run__via_scheduled_task__device(title) } it { is_expected.to contain_scheduled_task("run puppet device target #{task_name}").with( - 'command' => 'C:\\Program Files\\Puppet Labs\\Puppet\\bin\\puppet', + 'command' => 'C:\\Program Files\\Puppet Labs\\Puppet\\bin\\puppet', + 'arguments' => "device --user=root --waitforcert=0 --verbose --logdest eventlog --target=#{title}", ) } end @@ -207,7 +208,7 @@ it { is_expected.to contain_device_manager__run__via_exec__device(title) } it { is_expected.to contain_exec("run puppet device target #{title}").with( - 'command' => %("/opt/puppetlabs/puppet/bin/puppet" device --user=root --waitforcert=0 --verbose --target=#{title}), + 'command' => %("/opt/puppetlabs/puppet/bin/puppet" device --user=root --waitforcert=0 --verbose --logdest syslog --target=#{title}), ) } end