Skip to content

Commit

Permalink
Merge pull request #976 from mmoll/jessie_passenger
Browse files Browse the repository at this point in the history
add passenger support for Debian/jessie
  • Loading branch information
hunner committed Jan 8, 2015
2 parents e5d68eb + 35d7d04 commit 9d5ef27
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.passenger.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ puppetlabs-apache:
OS | Passenger version | `PassengerRoot`
---------------- | ------------------ | ----------------
Debian 7 | 3.0.13 | /usr
Debian 8 | 4.0.53 | /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
Ubuntu 12.04 | 2.2.11 | /usr
Ubuntu 14.04 | 4.0.37 | /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
RHEL with EPEL6 | 3.0.21 | /usr/lib/ruby/gems/1.8/gems/passenger-3.0.21
Expand Down
5 changes: 5 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@
$passenger_ruby = '/usr/bin/ruby'
$passenger_default_ruby = undef
}
'jessie': {
$passenger_root = '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini'
$passenger_ruby = undef
$passenger_default_ruby = '/usr/bin/ruby'
}
default: {
# The following settings may or may not work on Debian releases not
# supported by this module.
Expand Down
12 changes: 10 additions & 2 deletions spec/acceptance/mod_passenger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
when 'wheezy'
passenger_root = '/usr'
passenger_ruby = '/usr/bin/ruby'
when 'jessie'
passenger_root = '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini'
passenger_ruby = '/usr/bin/ruby'
passenger_default_ruby = '/usr/bin/ruby'
else
# This may or may not work on Debian releases other than the above
passenger_root = '/usr'
Expand Down Expand Up @@ -124,6 +128,9 @@ class { 'apache::mod::passenger': }
when 'wheezy'
it { is_expected.to contain "PassengerRuby \"#{passenger_ruby}\"" }
it { is_expected.not_to contain "/PassengerDefaultRuby/" }
when 'jessie'
it { is_expected.to contain "PassengerDefaultRuby \"#{passenger_ruby}\"" }
it { is_expected.not_to contain "/PassengerRuby/" }
else
# This may or may not work on Debian releases other than the above
it { is_expected.to contain "PassengerRuby \"#{passenger_ruby}\"" }
Expand All @@ -142,9 +149,10 @@ class { 'apache::mod::passenger': }
expect(r.stdout).to match(/Nginx processes/)
expect(r.stdout).to match(/Passenger processes/)

# passenger-memory-stats output on Ubuntu 14.04 does not contain
# passenger-memory-stats output on newer Debian/Ubuntu verions do not contain
# these two lines
unless fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemrelease') == '14.04'
unless ((fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemrelease') == '14.04') or
(fact('operatingsystem') == 'Debian' && fact('operatingsystemrelease') == '8.0'))
expect(r.stdout).to match(/### Processes: [0-9]+/)
expect(r.stdout).to match(/### Total private dirty RSS: [0-9\.]+ MB/)
end
Expand Down
19 changes: 19 additions & 0 deletions spec/classes/mod/passenger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,25 @@
it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRuby "/usr/bin/ruby"}) }
it { is_expected.to contain_file('passenger.conf').without_content(/PassengerDefaultRuby/) }
end

context "with Debian 8 defaults" do
let :facts do
{
:osfamily => 'Debian',
:operatingsystemrelease => '8.0',
:operatingsystem => 'Debian',
:kernel => 'Linux',
:lsbdistcodename => 'jessie',
:concat_basedir => '/dne',
:id => 'root',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end

it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRoot "/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini"}) }
it { is_expected.to contain_file('passenger.conf').without_content(/PassengerRuby/) }
it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerDefaultRuby "/usr/bin/ruby"}) }
end
end

context "on a RedHat OS" do
Expand Down
2 changes: 1 addition & 1 deletion templates/mod/passenger.conf.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The Passanger Apache module configuration file is being
# The Passenger Apache module configuration file is being
# managed by Puppet and changes will be overwritten.
<IfModule mod_passenger.c>
<%- if @passenger_root -%>
Expand Down

0 comments on commit 9d5ef27

Please sign in to comment.