summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-02-17 16:50:26 -0200
committerSilvio Rhatto <rhatto@riseup.net>2010-02-17 16:50:26 -0200
commitc4e6d980566e4902b25ca40f0d56772f491cd686 (patch)
treec2b02e6f0287cf6f53399af8f9b2ed7d7496736e
parent2448fbb72c6caed419ea7ef0aab5505af2551f93 (diff)
downloadpuppet-puppet-c4e6d980566e4902b25ca40f0d56772f491cd686.tar.gz
puppet-puppet-c4e6d980566e4902b25ca40f0d56772f491cd686.tar.bz2
Adding support for mongrel
-rw-r--r--.gitignore1
-rw-r--r--manifests/puppetmasterd.pp29
-rw-r--r--templates/puppetmaster.erb (renamed from files/etc/default/puppetmaster)11
3 files changed, 33 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1377554
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.swp
diff --git a/manifests/puppetmasterd.pp b/manifests/puppetmasterd.pp
index 2b7ace5..671d787 100644
--- a/manifests/puppetmasterd.pp
+++ b/manifests/puppetmasterd.pp
@@ -1,5 +1,22 @@
# handles puppetmasterd service
class puppetmasterd {
+
+ # Configuration
+ case $puppetmaster_servertype {
+ '': {
+ $puppetmaster_servertype = 'mongrel'
+ $puppetmaster_daemon_opts = '--ssl_client_header=HTTP_X_SSL_SUBJECT'
+ }
+ }
+
+ case $puppetmaster_puppetmasters {
+ '': { $puppetmaster_puppetmasters = '4' }
+ }
+
+ case $puppetmaster_port {
+ '': { $puppetmaster_port = '18140' }
+ }
+
# warns that this node has a puppetmaster
$puppetmasterd_present = true
@@ -16,10 +33,20 @@ class puppetmasterd {
# for storeconfigs
include mysql::server
+ file { "/etc/default/puppetmaster":
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 0644,
+ content => template('puppet/puppetmaster.erb'),
+ notify => Service['puppetmaster'],
+ }
+
service { "puppetmaster":
enable => true,
ensure => running,
hasrestart => true,
+ require => Package['puppetmaster'],
}
# cron rule to update puppet config repository every 5 minutes
@@ -49,7 +76,7 @@ class puppetmasterd {
ensure => present,
}
- # TODO: database creation as suggested by
+ # Database creation as suggested by
# http://reductivelabs.com/trac/puppet/wiki/Recipes/MySQLStoredConfiguration
#exec { "create-storeconfigs-db":
# command => "/usr/bin/mysqladmin create puppet",
diff --git a/files/etc/default/puppetmaster b/templates/puppetmaster.erb
index 23a7dfd..0aa5f3b 100644
--- a/files/etc/default/puppetmaster
+++ b/templates/puppetmaster.erb
@@ -5,7 +5,7 @@ START=yes
# Startup options
#DAEMON_OPTS=""
-DAEMON_OPTS="--ssl_client_header=HTTP_X_SSL_SUBJECT"
+DAEMON_OPTS="<%= puppetmaster_daemon_opts %>"
# What server type to run
# Options:
@@ -16,13 +16,11 @@ DAEMON_OPTS="--ssl_client_header=HTTP_X_SSL_SUBJECT"
# mongrel. Requires front-end web-proxy such as
# apache, nginx, or pound)
# See: http://reductivelabs.com/trac/puppet/wiki/UsingMongrel
-#SERVERTYPE=webrick
-SERVERTYPE=mongrel
+SERVERTYPE=<%= puppetmaster_servertype %>
# How many puppetmaster instances to start? Its pointless to set this
# higher than 1 if you are not using mongrel.
-#PUPPETMASTERS=1
-PUPPETMASTERS=4
+PUPPETMASTERS=<%= puppetmaster_puppetmasters %>
# What port should the puppetmaster listen on (default: 8140). If
# PUPPETMASTERS is set to a number greater than 1, then the port for
@@ -36,5 +34,4 @@ PUPPETMASTERS=4
# 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=8140
-PORT=18140
+PORT=<%= puppetmaster_port %>