Skip to content

Commit 5b33ad3

Browse files
committed
Changing name to rvm_passenger
1 parent 13640b7 commit 5b33ad3

9 files changed

Lines changed: 62 additions & 74 deletions

File tree

‎attributes/default.rb‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
2-
# Cookbook Name:: passenger_enterprise
3-
# Based on passenger_apache2
4-
# attributes:: passenger_enterprise
2+
# Cookbook Name:: rvm_passenger
3+
# Based on passenger_enterprise
4+
# attributes:: rvm_passenger
55
#
66
# Author:: Joshua Timberman (<joshua@opscode.com>)
77
# Author:: Joshua Sierles (<joshua@37signals.com>)
@@ -25,6 +25,7 @@
2525
# See the License for the specific language governing permissions and
2626
# limitations under the License.
2727
#
28-
default[:passenger_enterprise][:version] = "3.0.0.pre4"
29-
default[:passenger_enterprise][:root_path] = "/usr/local/rvm/gems/ree-1.8.7-2010.02/gems/passenger-#{passenger_enterprise[:version]}"
30-
default[:passenger_enterprise][:module_path] = "#{passenger_enterprise[:root_path]}/ext/apache2/mod_passenger.so"
28+
default[:rvm_passenger][:version] = "3.0.0"
29+
default[:rvm_passenger][:rvm_ruby] = "ree-1.8.7-2010.02"
30+
default[:rvm_passenger][:root_path] = "/usr/local/rvm/gems/#{rvm_passenger[:rvm_ruby]}/gems/passenger-#{rvm_passenger[:version]}"
31+
default[:rvm_passenger][:module_path] = "#{rvm_passenger[:root_path]}/ext/apache2/mod_passenger.so"

‎metadata.json‎

Lines changed: 0 additions & 44 deletions
This file was deleted.

‎metadata.rb‎

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
11
maintainer "Opscode, Inc."
22
maintainer_email "ops@opscode.com"
33
license "Apache 2.0"
4-
description "Installs and configures Passenger under Ruby Enterprise Edition with Apache"
4+
description "Installs and configures Passenger under RVM with Apache or nginx"
55
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
6-
version "0.4.2"
6+
version "0.5.0"
77

8-
recipe "passenger_enterprise", "Installs Passenger gem with Ruby Enterprise Edition"
9-
recipe "passenger_enterprise::apache2", "Enables Apache module configuration for passenger under Ruby Enterprise Edition"
10-
recipe "passenger_enterprise::nginx", "Installs Passenger gem w/ REE, and recompiles support into Nginx"
8+
recipe "rvm_passenger", "Installs Passenger gem with RVM"
9+
recipe "rvm_passenger::apache2", "Enables Apache module configuration for passenger under RVM"
10+
recipe "rvm_passenger::nginx", "Installs Passenger gem w/ RVM, and recompiles support into Nginx"
1111

1212
%w{ rvm nginx apache2 }.each do |cb|
1313
depends cb
1414
end
1515

16-
supports "ubuntu"
16+
%w{ ubuntu }.each do |os|
17+
supports os
18+
end
19+
20+
attribute "rvm_passenger/version",
21+
:display_name => "Version of passenger",
22+
:description => "The version of passenger to deploy. This will be in a format used by the gem command.",
23+
:default => "3.0.0"
24+
25+
attribute "rvm_passenger/rvm_ruby",
26+
:display_name => "RVM ruby to use",
27+
:description => "The RVM ruby (and optional gemset) under which to install the passenger gem. This will be in a format used by the rvm command.",
28+
:default => "ree-1.8.7-2010.02"
29+
30+
attribute "rvm_passenger/root_path",
31+
:display_name => "Root path to passenger gem",
32+
:description => "The full path to the root of the installed passenger gem.",
33+
:default => "/usr/local/rvm/gems/ree-1.8.7-2010.02/gems/passenger-3.0.0"
34+
35+
attribute "rvm_passenger/module_path",
36+
:display_name => "Path to mod_passenger.so",
37+
:description => "The full path to the Apache2 module.",
38+
:default => "/usr/local/rvm/gems/ree-1.8.7-2010.02/gems/passenger-3.0.0/ext/apache2/mod_passenger.so"
39+

‎recipes/apache2.rb‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
2-
# Cookbook Name:: passenger_enterprise
3-
# Based on passenger_apache2
2+
# Cookbook Name:: rvm_passenger
3+
# Based on passenger_enterprise
44
# Recipe:: apache2
55
#
66
# Author:: Joshua Timberman (<joshua@opscode.com>)
@@ -10,6 +10,7 @@
1010
# Copyright:: 2009, Opscode, Inc
1111
# Copyright:: 2009, 37signals
1212
# Coprighty:: 2009, Michael Hale
13+
# Copyright:: 2010, Fletcher Nichol
1314
#
1415
# Licensed under the Apache License, Version 2.0 (the "License");
1516
# you may not use this file except in compliance with the License.
@@ -23,7 +24,7 @@
2324
# See the License for the specific language governing permissions and
2425
# limitations under the License.
2526

26-
include_recipe "passenger_enterprise"
27+
include_recipe "rvm_passenger"
2728
include_recipe "apache2"
2829

2930
%w{ apache2-threaded-dev libapr1-dev libaprutil1-dev }.each do |pkg|
@@ -34,7 +35,7 @@
3435

3536
execute "passenger_apache2_module" do
3637
command "#{node[:ruby_enterprise][:install_path]}/bin/passenger-install-apache2-module -a"
37-
creates node[:passenger_enterprise][:module_path]
38+
creates node[:rvm_passenger][:module_path]
3839
end
3940

4041
template "#{node[:apache][:dir]}/mods-available/passenger.load" do

‎recipes/default.rb‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
2-
# Cookbook Name:: passenger_enterprise
3-
# Based on passenger_apache2, adapted for nginx too.
2+
# Cookbook Name:: rvm_passenger
3+
# Based on passenger_enterprise
44
# Recipe:: default
55
#
66
# Author:: Joshua Timberman (<joshua@opscode.com>)
@@ -10,6 +10,7 @@
1010
# Copyright:: 2009, Opscode, Inc
1111
# Copyright:: 2009, 37signals
1212
# Coprighty:: 2009, Michael Hale
13+
# Copyright:: 2010, Fletcher Nichol
1314
#
1415
# Licensed under the Apache License, Version 2.0 (the "License");
1516
# you may not use this file except in compliance with the License.
@@ -29,6 +30,8 @@
2930
action :install
3031
end
3132

32-
ree_gem "passenger" do
33-
version node[:passenger_enterprise][:version]
33+
rvm_gem "passenger" do
34+
ruby node[:rvm_passenger][:rvm_ruby]
35+
version node[:rvm_passenger][:version]
3436
end
37+

‎recipes/nginx.rb‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
2-
# Cookbook Name:: passenger_enterprise
2+
# Cookbook Name:: rvm_passenger
3+
# Based on passenger_enterprise
34
# Recipe:: nginx
45
#
56
# Author:: Joshua Timberman (<joshua@opscode.com>)
@@ -9,6 +10,7 @@
910
# Copyright:: 2009, Opscode, Inc
1011
# Copyright:: 2009, 37signals
1112
# Coprighty:: 2009, Michael Hale
13+
# Copyright:: 2010, Fletcher Nichol
1214
#
1315
# Licensed under the Apache License, Version 2.0 (the "License");
1416
# you may not use this file except in compliance with the License.
@@ -23,7 +25,7 @@
2325
# limitations under the License.
2426

2527
include_recipe "nginx::source"
26-
include_recipe "passenger_enterprise"
28+
include_recipe "rvm_passenger"
2729

2830
configure_flags = node[:nginx][:configure_flags].join(" ")
2931
nginx_install = node[:nginx][:install_path]
@@ -32,12 +34,14 @@
3234

3335
execute "passenger_nginx_module" do
3436
command %Q{
35-
#{node[:ruby_enterprise][:install_path]}/bin/passenger-install-nginx-module \
36-
--auto --prefix=#{nginx_install} \
37-
--nginx-source-dir=/tmp/nginx-#{nginx_version} \
38-
--extra-configure-flags='#{configure_flags}'
37+
source /etc/profile.d/rvm.sh && \
38+
rvm #{node[:rvm_passenger][:rvm_ruby]} exec \
39+
passenger-install-nginx-module \
40+
--auto --prefix=#{nginx_install} \
41+
--nginx-source-dir=/tmp/nginx-#{nginx_version} \
42+
--extra-configure-flags='#{configure_flags}'
3943
}
40-
not_if "#{nginx_install}/sbin/nginx -V 2>&1 | grep '#{node[:ruby_enterprise][:gems_dir]}/gems/passenger-#{node[:passenger_enterprise][:version]}/ext/nginx'"
44+
not_if %{#{nginx_install}/sbin/nginx -V 2>&1 | grep "#{node[:rvm_passenger][:root_path]}/ext/nginx"}
4145
notifies :restart, resources(:service => "nginx")
4246
end
4347

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
PassengerRoot <%= node[:passenger_enterprise][:root_path] %>
1+
PassengerRoot <%= node[:rvm_passenger][:root_path] %>
22
PassengerRuby <%= node[:ruby_enterprise][:ruby_bin] %>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
LoadModule passenger_module <%= node[:passenger_enterprise][:module_path] %>
1+
LoadModule passenger_module <%= node[:rvm_passenger][:module_path] %>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
passenger_root <%= node[:passenger_enterprise][:root_path] %>;
1+
passenger_root <%= node[:rvm_passenger][:root_path] %>;
22
passenger_ruby <%= node[:ruby_enterprise][:ruby_bin] %>;

0 commit comments

Comments
 (0)