# 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
# 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
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",
# Startup options
#DAEMON_OPTS=""
-DAEMON_OPTS="--ssl_client_header=HTTP_X_SSL_SUBJECT"
+DAEMON_OPTS="<%= puppetmaster_daemon_opts %>"
# What server type to run
# Options:
# 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
# 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 %>