Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #16 from tkishel/FM-7148_logdest_system
Browse files Browse the repository at this point in the history
(FM-7148) logdest scheduled runs to system log
  • Loading branch information
davidmalloncares authored Jul 6, 2018
2 parents 7bb6be0 + 121bb3f commit 3f4978c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion manifests/run.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand All @@ -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=<device>'.
$targetable = (versioncmp($::puppetversion, '5.0.0') >= 0)
Expand Down
9 changes: 5 additions & 4 deletions spec/defines/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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' => '*',
)
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3f4978c

Please sign in to comment.