Skip to content

Commit b30f5f4

Browse files
committed
If puppet 4 setup bin and config file path
1 parent ef3a15e commit b30f5f4

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

manifests/agent.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
# ['group_id'] - The groupid of the puppet group
1818
# ['splay'] - If splay should be enable defaults to false
1919
# ['splaylimit'] - The maximum time to delay before runs.
20-
# ['classfile'] - The file in which puppet agent stores a list of the classes
21-
# associated with the retrieved configuration.
20+
# ['classfile'] - The file in which puppet agent stores a list of the classes
21+
# associated with the retrieved configuration.
2222
# ['logdir'] - The directory in which to store log files
2323
# ['environment'] - The environment of the puppet agent
2424
# ['report'] - Whether to return reports
@@ -64,7 +64,7 @@
6464
$version = 'present',
6565
$puppet_facter_package = $::puppet::params::puppet_facter_package,
6666
$puppet_run_style = 'service',
67-
$puppet_run_command = '/usr/bin/puppet agent --no-daemonize --onetime --logdest syslog > /dev/null 2>&1',
67+
$puppet_run_command = $::puppet::params::puppet_run_command,
6868
$user_id = undef,
6969
$group_id = undef,
7070
$package_provider = $::puppet::params::package_provider,
@@ -86,7 +86,7 @@
8686
$puppet_run_interval = $::puppet::params::puppet_run_interval,
8787
$splay = false,
8888

89-
# $splaylimit defaults to $runinterval per Puppetlabs docs:
89+
# $splaylimit defaults to $runinterval per Puppetlabs docs:
9090
# http://docs.puppetlabs.com/references/latest/configuration.html#splaylimit
9191
$splaylimit = $::puppet::params::puppet_run_interval,
9292
$classfile = $::puppet::params::classfile,

manifests/params.pp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@
4040
# Only used when environments == directory
4141
$environmentpath = "${confdir}/environments"
4242

43+
if versioncmp($::puppetversion, "4.0.0") >= 0 {
44+
$puppet_conf = '/etc/puppetlabs/puppet/puppet.conf'
45+
$puppet_run_command = '/opt/puppetlabs/bin/puppet agent --no-daemonize --onetime --logdest syslog > /dev/null 2>&1',
46+
} else {
47+
$puppet_conf = '/etc/puppet/puppet.conf'
48+
$puppet_run_command = '/usr/bin/puppet agent --no-daemonize --onetime --logdest syslog > /dev/null 2>&1',
49+
}
50+
4351
case $::osfamily {
4452
'RedHat': {
4553
$puppet_master_package = 'puppet-server'
@@ -48,7 +56,6 @@
4856
$puppet_agent_package = 'puppet'
4957
$package_provider = undef # falls back to system default
5058
$puppet_defaults = '/etc/sysconfig/puppet'
51-
$puppet_conf = '/etc/puppet/puppet.conf'
5259
$puppet_vardir = '/var/lib/puppet'
5360
$puppet_ssldir = '/var/lib/puppet/ssl'
5461
$passenger_package = 'mod_passenger'
@@ -61,7 +68,6 @@
6168
$puppet_agent_service = 'puppet'
6269
$puppet_agent_package = 'puppet'
6370
$package_provider = undef # falls back to system default
64-
$puppet_conf = '/etc/puppet/puppet.conf'
6571
$puppet_vardir = '/var/lib/puppet'
6672
$puppet_ssldir = '/var/lib/puppet/ssl'
6773
$passenger_package = 'rubygem-passenger-apache2'
@@ -74,7 +80,6 @@
7480
$puppet_agent_package = 'puppet'
7581
$package_provider = undef # falls back to system default
7682
$puppet_defaults = '/etc/default/puppet'
77-
$puppet_conf = '/etc/puppet/puppet.conf'
7883
$puppet_vardir = '/var/lib/puppet'
7984
$puppet_ssldir = '/var/lib/puppet/ssl'
8085
$passenger_package = 'libapache2-mod-passenger'
@@ -94,7 +99,6 @@
9499
$puppet_agent_package = 'puppet-3.8.5.dmg'
95100
$puppet_facter_package = 'facter.2.4.5.dmg'
96101
$package_provider = 'pkgdmg'
97-
$puppet_conf = '/etc/puppet/puppet.conf'
98102
$puppet_vardir = '/var/lib/puppet'
99103
$puppet_ssldir = '/etc/puppet/ssl'
100104
}

0 commit comments

Comments
 (0)