]> gitweb.fluxo.info Git - puppet-puppet.git/commitdiff
Adding support for mongrel
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 17 Feb 2010 18:50:26 +0000 (16:50 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 17 Feb 2010 18:50:26 +0000 (16:50 -0200)
.gitignore [new file with mode: 0644]
manifests/puppetmasterd.pp
templates/puppetmaster.erb [moved from files/etc/default/puppetmaster with 89% similarity]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..1377554
--- /dev/null
@@ -0,0 +1 @@
+*.swp
index 2b7ace5018a93fbab309469ed97df9d7cbbe0e82..671d78739ed7023c65a16b830e4b3ecb1a9e5e59 100644 (file)
@@ -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",
similarity index 89%
rename from files/etc/default/puppetmaster
rename to templates/puppetmaster.erb
index 23a7dfdc3696a4166f0d4f90449edfe272942b82..0aa5f3bb075787532736065aef72c0cc4b1c0e5e 100644 (file)
@@ -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 %>