Cleaned up puppet::client.

This commit is contained in:
Timo Mkinen 2009-09-22 20:04:57 +03:00
parent 58deae7730
commit c6c12bb4a7

View file

@ -1,8 +1,9 @@
# Install and configure Puppet client.
#
class puppet::client { class puppet::client {
case $operatingsystem { case $operatingsystem {
OpenBSD: { $vardir = "/var/puppet" } openbsd: { $vardir = "/var/puppet" }
default: { $vardir = "/var/lib/puppet" } default: { $vardir = "/var/lib/puppet" }
} }
@ -16,7 +17,7 @@ class puppet::client {
package { "puppet": package { "puppet":
name => $operatingsystem ? { name => $operatingsystem ? {
OpenBSD => "ruby-puppet", openbsd => "ruby-puppet",
default => "puppet", default => "puppet",
}, },
ensure => present, ensure => present,
@ -28,30 +29,31 @@ class puppet::client {
mode => 0600, mode => 0600,
owner => root, owner => root,
group => $operatingsystem ? { group => $operatingsystem ? {
OpenBSD => wheel, openbsd => wheel,
default => root default => root
}, },
require => Package["puppet"], require => Package["puppet"],
notify => Service["puppet"], notify => Service["puppet"],
} }
case $operatingsystem {
openbsd: {
service { "puppet": service { "puppet":
ensure => running, ensure => running,
enable => true, enable => true,
require => Package["puppet"],
}
case $operatingsystem {
OpenBSD: {
Service["puppet"] {
binary => "/usr/local/bin/puppetd", binary => "/usr/local/bin/puppetd",
start => "/usr/local/bin/puppetd", start => "/usr/local/bin/puppetd",
restart => "/usr/bin/pkill -HUP -f /usr/local/bin/puppetd",
pattern => puppetd, pattern => puppetd,
require => Package["puppet"],
} }
} }
default: { default: {
Service["puppet"] { service { "puppet":
ensure => running,
enable => true,
hasrestart => true, hasrestart => true,
require => Package["puppet"],
} }
} }
} }