From 22bacf19b4d8d8de489212022910fbd039eb4993 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Thu, 2 May 2013 23:05:37 +0300 Subject: [PATCH] puppet: Fixed passenger support for puppet 3 --- .../{puppet-config.ru => puppet2-config.ru} | 0 puppet/files/puppet3-config.ru | 36 +++++++++++++++++++ puppet/manifests/init.pp | 5 ++- 3 files changed, 40 insertions(+), 1 deletion(-) rename puppet/files/{puppet-config.ru => puppet2-config.ru} (100%) create mode 100644 puppet/files/puppet3-config.ru diff --git a/puppet/files/puppet-config.ru b/puppet/files/puppet2-config.ru similarity index 100% rename from puppet/files/puppet-config.ru rename to puppet/files/puppet2-config.ru diff --git a/puppet/files/puppet3-config.ru b/puppet/files/puppet3-config.ru new file mode 100644 index 0000000..984017e --- /dev/null +++ b/puppet/files/puppet3-config.ru @@ -0,0 +1,36 @@ +# 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: +# $LOAD_PATH.unshift('/opt/puppet/lib') + +$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 + diff --git a/puppet/manifests/init.pp b/puppet/manifests/init.pp index 9a09437..8c2439b 100644 --- a/puppet/manifests/init.pp +++ b/puppet/manifests/init.pp @@ -627,7 +627,10 @@ class puppet::server::passenger { mode => "0444", owner => "puppet", group => "puppet", - source => "puppet:///modules/puppet/puppet-config.ru", + source => $::puppetversion ? { + /^3\./ => "puppet:///modules/puppet/puppet3-config.ru", + default => "puppet:///modules/puppet/puppet2-config.ru", + }, } }