Added support for Debian and Ubuntu to puppet module.

This commit is contained in:
Ossi Salmi 2010-10-22 23:33:02 +03:00 committed by Timo Mkinen
parent 7c2fdbd268
commit f4f3f467a2
2 changed files with 84 additions and 6 deletions

View file

@ -50,6 +50,18 @@ class puppet::client {
subscribe => File["/etc/puppet/puppet.conf"],
}
}
debian,ubuntu: {
service { "puppet":
ensure => running,
enable => true,
restart => "/usr/bin/pkill -HUP puppetd",
subscribe => File["/etc/puppet/puppet.conf"],
}
augeas { "set-default-puppet":
context => "/files/etc/default/puppet",
changes => ["set START yes"],
}
}
default: {
service { "puppet":
ensure => running,
@ -95,6 +107,14 @@ class puppet::manual inherits puppet::client {
ensure => absent,
}
case $operatingsystem {
debian,ubuntu: {
Augeas["set-default-puppet"] {
changes => ["set START no"],
}
}
}
}
@ -129,6 +149,7 @@ class puppet::server inherits puppet::client {
package { "puppetmaster":
name => $operatingsystem ? {
debian => "puppetmaster",
ubuntu => "puppetmaster",
default => "puppet-server",
},
@ -145,10 +166,21 @@ class puppet::server inherits puppet::client {
include mongrel
include ldap::client::ruby
package { [ "rubygem-rails",
"rubygem-sqlite3-ruby",
"ruby-RRDtool", ]:
ensure => installed,
case $operatingsystem {
debian,ubuntu: {
package { [ "rails",
regsubst($rubyversion, '^([0-9]+\.[0-9]+)\..*', 'libsqlite3-ruby\1'),
regsubst($rubyversion, '^([0-9]+\.[0-9]+)\..*', 'librrd-ruby\1'), ]:
ensure => installed,
}
}
default: {
package { [ "rubygem-rails",
"rubygem-sqlite3-ruby",
"ruby-RRDtool", ]:
ensure => installed,
}
}
}
if $puppet_datadir {
@ -254,9 +286,19 @@ class puppet::server inherits puppet::client {
require => Package["puppetmaster"],
notify => Service["puppetmaster"],
}
case $operatingsystem {
fedora,centos: {
debian,ubuntu: {
file { "/etc/default/puppetmaster":
ensure => present,
content => template("puppet/puppetmaster.default.erb"),
mode => 0644,
owner => root,
group => root,
notify => Service["puppetmaster"],
}
}
default: {
file { "/etc/sysconfig/puppetmaster":
ensure => present,
content => template("puppet/puppetmaster.sysconfig.erb"),

View file

@ -0,0 +1,36 @@
# Defaults for puppetmaster - sourced by /etc/init.d/puppetmaster
# Start puppet on boot?
START=yes
# Startup options
DAEMON_OPTS=""
# What server type to run
# Options:
# webrick (default, cannot handle more than ~30 nodes)
# mongrel (scales better than webrick because you can run
# multiple processes if you are getting
# connection-reset or End-of-file errors, switch to
# mongrel. Requires front-end web-proxy such as
# apache, nginx, or pound)
# See: http://reductivelabs.com/trac/puppet/wiki/UsingMongrel
SERVERTYPE=mongrel
# How many puppetmaster instances to start? Its pointless to set this
# higher than 1 if you are not using mongrel.
PUPPETMASTERS=<%= puppet_listenports.length %>
# What port should the puppetmaster listen on (default: 8140). If
# PUPPETMASTERS is set to a number greater than 1, then the port for
# the first puppetmaster will be set to the port listed below, and
# further instances will be incremented by one
#
# NOTE: if you are using mongrel, then you will need to have a
# front-end web-proxy (such as apache, nginx, pound) that takes
# incoming requests on the port your clients are connecting to
# (default is: 8140), and then passes them off to the mongrel
# processes. In this case it is recommended to run your web-proxy on
# port 8140 and change the below number to something else, such as
# 18140.
PORT=<%= puppet_listenports.first %>