puppet: Fixed agent restart with newer puppet versions

This commit is contained in:
Ossi Salmi 2013-06-17 17:43:03 +03:00
parent 79321c4375
commit 1c3422e0e1

View file

@ -75,11 +75,11 @@ class puppet::client {
enable => true, enable => true,
status => $::puppetversion ? { status => $::puppetversion ? {
/^[0-2]\./ => "pgrep -f /usr/local/sbin/puppetd", /^[0-2]\./ => "pgrep -f /usr/local/sbin/puppetd",
default => "pgrep -f /usr/local/bin/puppet", default => "pgrep -f '/usr/local/bin/puppet agent'",
}, },
restart => $::puppetversion ? { restart => $::puppetversion ? {
/^[0-2]\./ => "pkill -HUP -f /usr/local/sbin/puppetd", /^[0-2]\./ => "pkill -HUP -f /usr/local/sbin/puppetd",
default => "pkill -HUP -f /usr/local/bin/puppet", default => "pkill -HUP -f '/usr/local/bin/puppet agent'",
}, },
subscribe => File["/etc/puppet/puppet.conf"], subscribe => File["/etc/puppet/puppet.conf"],
} }
@ -88,7 +88,10 @@ class puppet::client {
service { "puppet": service { "puppet":
ensure => running, ensure => running,
enable => true, enable => true,
restart => "/usr/bin/pkill -HUP puppetd", restart => $::puppetversion ? {
/^0\./ => "pkill -HUP puppetd",
default => "pkill -HUP -f '/usr/bin/puppet agent'",
},
subscribe => File["/etc/puppet/puppet.conf"], subscribe => File["/etc/puppet/puppet.conf"],
} }
file { "/etc/default/puppet": file { "/etc/default/puppet":
@ -104,7 +107,10 @@ class puppet::client {
service { "puppet": service { "puppet":
ensure => running, ensure => running,
enable => true, enable => true,
restart => "/usr/bin/pkill -HUP puppetd", restart => $::puppetversion ? {
/^[0-2]\./ => "pkill -HUP puppetd",
default => "pkill -HUP -f '/usr/bin/puppet agent'",
},
subscribe => File["/etc/puppet/puppet.conf"], subscribe => File["/etc/puppet/puppet.conf"],
} }
} }