]> git.openstreetmap.org Git - chef.git/commitdiff
Add support for passenger 4 using the phusion repos
authorTom Hughes <tom@compton.nu>
Mon, 7 Jul 2014 18:12:13 +0000 (19:12 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 7 Jul 2014 19:11:25 +0000 (20:11 +0100)
cookbooks/apache/providers/module.rb
cookbooks/apache/resources/module.rb
cookbooks/apt/recipes/default.rb
cookbooks/passenger/attributes/default.rb
cookbooks/passenger/recipes/default.rb
cookbooks/passenger/templates/default/passenger.conf.erb

index 17008371ec844d55698c49fcd2364f87432db2f6..31910ed077a919672f5a209ba2dd0ab6311b2ec0 100644 (file)
@@ -23,7 +23,9 @@ end
 
 action :install do
   if not installed?
-    package package_name
+    package package_name do
+      version new_resource.version
+    end
 
     updated = true
   else
index f2d95551ec486a42d7709d2cbf3aa4f4b95a5f93..2d077509f5cae0c568890668b84a3b8fa8c3c6ab 100644 (file)
@@ -22,5 +22,6 @@ default_action [:install, :enable]
 
 attribute :name, :kind_of => String, :name_attribute => true
 attribute :package, :kind_of => String
+attribute :version, :kind_of => String
 attribute :conf, :kind_of => String
 attribute :variables, :kind_of => Hash, :default => {}
index dea088bb66a8b48263fe19788da8b96a9c534121..1b48ddfda4b5ae0b6cf89f23014f207b555d62ba 100644 (file)
@@ -113,3 +113,8 @@ apt_source "elasticsearch" do
   url "http://packages.elasticsearch.org/elasticsearch/1.0/debian"
   key "D88E42B4"
 end
+
+apt_source "passenger" do
+  url "https://oss-binaries.phusionpassenger.com/apt/passenger"
+  key "AC40B2F7"
+end
index 0c1c8ece5c67066d786609535702023421959efe..eff26a2361706180003b27cf616bdbb5d2eb6456 100644 (file)
@@ -1,5 +1,6 @@
-default[:apt][:sources] = node[:apt][:sources] |  [ "brightbox-ruby-ng" ]
+default[:apt][:sources] = node[:apt][:sources] |  [ "brightbox-ruby-ng", "passenger" ]
 
+default[:passenger][:version] = "3.0.21"
 default[:passenger][:ruby_version] = "1.9.1"
 default[:passenger][:max_pool_size] = 6
 default[:passenger][:pool_idle_time] = 300
index d2254337037aee90088c8784fec1ca5b3d0bad92..769342ef9889b04afa33a5b453e3956d1d252872 100644 (file)
@@ -33,6 +33,7 @@ template "/usr/local/bin/passenger-ruby" do
 end
 
 apache_module "passenger" do
+  version node[:passenger][:version]
   conf "passenger.conf.erb"
 end
 
index a234b15a2ca7c5a393c5d89552e7bab880046fc9..7db2728b7795acae5158ff4c35e8d52f11c28d46 100644 (file)
@@ -1,7 +1,12 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
 <IfModule mod_passenger.c>
+<% if node[:passenger][:version] >= "4" -%>
+  PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
+  PassengerDefaultRuby /usr/bin/ruby
+<% else -%>
   PassengerRoot /usr
+<% end -%>
   PassengerRuby /usr/local/bin/passenger-ruby
   PassengerUseGlobalQueue on
   PassengerMaxPoolSize <%= node[:passenger][:max_pool_size] %>