puppet: Add passenger config.ru to the module

This commit is contained in:
Ossi Salmi 2014-01-20 01:26:11 +02:00
parent 4a071406d7
commit 979f22cda0
3 changed files with 51 additions and 1 deletions

17
puppet/files/config.ru.2 Normal file
View file

@ -0,0 +1,17 @@
$0 = "master"
# if you want debugging:
# ARGV << "--debug"
ARGV << "--rack"
# Rack applications typically don't start as root. Set --confdir and --vardir
# to prevent reading configuration from ~puppet/.puppet/puppet.conf and writing
# to ~puppet/.puppet
ARGV << "--confdir" << "/etc/puppet"
ARGV << "--vardir" << "/var/lib/puppet"
require 'puppet/application/master'
# we're usually running inside a Rack::Builder.new {} block,
# therefore we need to call run *here*.
run Puppet::Application[:master].run

29
puppet/files/config.ru.3 Normal file
View file

@ -0,0 +1,29 @@
$0 = "master"
# if you want debugging:
# ARGV << "--debug"
ARGV << "--rack"
# Rack applications typically don't start as root. Set --confdir and --vardir
# to prevent reading configuration from ~puppet/.puppet/puppet.conf and writing
# to ~puppet/.puppet
ARGV << "--confdir" << "/etc/puppet"
ARGV << "--vardir" << "/var/lib/puppet"
# NOTE: it's unfortunate that we have to use the "CommandLine" class
# here to launch the app, but it contains some initialization logic
# (such as triggering the parsing of the config file) that is very
# important. We should do something less nasty here when we've
# gotten our API and settings initialization logic cleaned up.
#
# Also note that the "$0 = master" line up near the top here is
# the magic that allows the CommandLine class to know that it's
# supposed to be running master.
#
# --cprice 2012-05-22
require 'puppet/util/command_line'
# we're usually running inside a Rack::Builder.new {} block,
# therefore we need to call run *here*.
run Puppet::Util::CommandLine.new.execute

View file

@ -665,6 +665,7 @@ class puppet::server::passenger {
owner => "root",
group => "root",
}
file { "/var/lib/passenger/puppet/config.ru":
ensure => present,
mode => "0444",
@ -676,7 +677,10 @@ class puppet::server::passenger {
"ubuntu" => "puppet",
default => "root",
},
source => "/usr/share/puppet/ext/rack/files/config.ru",
source => $::puppetversion ? {
/^[0-2]\./ => "puppet:///modules/puppet/config.ru.2",
default => "puppet:///modules/puppet/config.ru.3",
},
}
}