From 35d7d04afdd8b6e0d00fa5807420d531bc7de86c Mon Sep 17 00:00:00 2001 From: Michael Moll Date: Fri, 2 Jan 2015 03:28:29 +0100 Subject: [PATCH] add passenger support for Debian/jessie --- README.passenger.md | 1 + manifests/params.pp | 5 +++++ spec/acceptance/mod_passenger_spec.rb | 12 ++++++++++-- spec/classes/mod/passenger_spec.rb | 19 +++++++++++++++++++ templates/mod/passenger.conf.erb | 2 +- 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/README.passenger.md b/README.passenger.md index 4b4caa8c0..84e6992ff 100644 --- a/README.passenger.md +++ b/README.passenger.md @@ -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 diff --git a/manifests/params.pp b/manifests/params.pp index d7e00ca18..616102fa6 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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. diff --git a/spec/acceptance/mod_passenger_spec.rb b/spec/acceptance/mod_passenger_spec.rb index 4b3516f69..f6e710db0 100644 --- a/spec/acceptance/mod_passenger_spec.rb +++ b/spec/acceptance/mod_passenger_spec.rb @@ -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' @@ -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}\"" } @@ -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 diff --git a/spec/classes/mod/passenger_spec.rb b/spec/classes/mod/passenger_spec.rb index 23154014a..0093d4b91 100644 --- a/spec/classes/mod/passenger_spec.rb +++ b/spec/classes/mod/passenger_spec.rb @@ -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 diff --git a/templates/mod/passenger.conf.erb b/templates/mod/passenger.conf.erb index dd9eee3b1..a56d2d5d1 100644 --- a/templates/mod/passenger.conf.erb +++ b/templates/mod/passenger.conf.erb @@ -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. <%- if @passenger_root -%>