diff options
-rw-r--r-- | files/master/config.ru | 27 | ||||
-rw-r--r-- | manifests/puppetmaster/passenger.pp | 45 |
2 files changed, 72 insertions, 0 deletions
diff --git a/files/master/config.ru b/files/master/config.ru new file mode 100644 index 0000000..b9d8fbc --- /dev/null +++ b/files/master/config.ru @@ -0,0 +1,27 @@ +# a config.ru, for use with every rack-compatible webserver. +# SSL needs to be handled outside this, though. + +# if puppet is not in your RUBYLIB: +# $:.unshift('/opt/puppet/lib') + +$0 = "puppetmasterd" +require 'puppet' + +# logs to file instead of syslog +#Puppet::Util::Log.newdestination("/var/log/puppet/puppetmasterd.log") + +# if you want debugging: +#ARGV << "--debug" + +ARGV << "--rack" + +# in some setups puppetmasterd doesn't seem to read the puppet.conf +# config at startup, then you need to pass these options: +ARGV << "--vardir" << "/var/lib/puppet" +ARGV << "--ssldir" << "/var/lib/puppet/ssl" + + +require 'puppet/application/puppetmasterd' +# we're usually running inside a Rack::Builder.new {} block, +# therefore we need to call run *here*. +run Puppet::Application[:puppetmasterd].run diff --git a/manifests/puppetmaster/passenger.pp b/manifests/puppetmaster/passenger.pp new file mode 100644 index 0000000..63b2fab --- /dev/null +++ b/manifests/puppetmaster/passenger.pp @@ -0,0 +1,45 @@ +# class to use passenger for serving puppetmaster + +class puppet::puppetmaster::passenger { + + case $operatingsystem { + debian: { include puppet::puppetmaster::passenger::debian } + defaults: { include puppet::puppetmaster::passenger::base } + } +} + +class puppet::puppetmaster::passenger::debian inherits puppet::puppetmaster::passenger::base { + # according to http://github.com/reductivelabs/puppet/tree/master/ext/rack rack needs + # to be version >= 1.0.0 . lenny-backports provide it + package { "librack-ruby": ensure => "1.0.0-2~bpo50+1" } + package { "librack-ruby1.8": ensure => "1.0.0-2~bpo50+1" } + + apache::config::global{ 'puppet-apache2-passenger.conf': } + apache::debian::module { 'ssl': ensure => present } + apache::debian::module { 'passenger': ensure => present } + apache::debian::module { 'headers': ensure => present } +} + +class puppet::puppetmaster::passenger::base { + notice ( "class puppet::puppetmaster::passenger::base needs to be configured for using passenger with non-debian OS !" ) + + include apache + include passenger::apache + + + # http://github.com/reductivelabs/puppet/tree/master/ext/rack + file { ["/etc/puppet/rack", "/etc/puppet/rack/public"]: + ensure => directory, + mode => 0755, + owner => root, + group => root, + } + file { "/etc/puppet/rack/config.ru": + ensure => present, + source => "puppet:///modules/puppet/master/config.ru", + mode => 0644, + owner => puppet, + group => root, + } +} + |