diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2010-02-17 16:50:26 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2010-02-17 16:50:26 -0200 |
commit | c4e6d980566e4902b25ca40f0d56772f491cd686 (patch) | |
tree | c2b02e6f0287cf6f53399af8f9b2ed7d7496736e | |
parent | 2448fbb72c6caed419ea7ef0aab5505af2551f93 (diff) | |
download | puppet-puppet-c4e6d980566e4902b25ca40f0d56772f491cd686.tar.gz puppet-puppet-c4e6d980566e4902b25ca40f0d56772f491cd686.tar.bz2 |
Adding support for mongrel
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | manifests/puppetmasterd.pp | 29 | ||||
-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 %> |