From 2c58046332145c024f7b848f040b6f139be784ba Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Wed, 14 May 2014 17:39:23 -0400 Subject: [PATCH 01/12] Prepare a 1.1.0 release. --- CHANGELOG.md | 35 +++++++++++++++++++++++++++++++++++ Modulefile | 2 +- metadata.json | 2 +- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26e8d75d4..c77316a48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,38 @@ +## 2014-04-14 Supported Release 1.1.0 + +###Summary + +This release primarily focuses on extending the httpd 2.4 support, tested +through adding RHEL7 and Ubuntu 14.04 support. It also includes Passenger +4 support, as well as several new modules and important bugfixes. + +####Features + +- Add support for RHEL7 and Ubuntu 14.04 +- More complete apache24 support +- Passenger 4 support +- Add support for max_keepalive_requests and log_formats parameters +- Add mod_pagespeed support +- Add mod_speling support +- Added several parameters for mod_passenger +- Added ssl_cipher parameter to apache::mod::ssl +- Improved examples in documentation +- Added docroot_mode, action, and suexec_user_group parameters to apache::vhost +- Add support for custom extensions for mod_php +- Improve proxy_html support for Debian + +####Bugfixes + +- Remove NameVirtualHost directive for apache >= 2.4 +- Order proxy_set option so it doesn't change between runs +- Fix inverted SSL compression +- Fix missing ensure on concat::fragment resources +- Fix bad dependencies in apache::mod and apache::mod::mime + +####Known Bugs +* By default, the version of Apache that ships with Ubuntu 10.04 does not work with `wsgi_import_script`. +* SLES is unsupported. + ## 2014-03-04 Supported Release 1.0.1 ###Summary diff --git a/Modulefile b/Modulefile index 227947cbb..49a712bcd 100644 --- a/Modulefile +++ b/Modulefile @@ -1,5 +1,5 @@ name 'puppetlabs-apache' -version '1.0.1' +version '1.1.0' source 'git://github.com/puppetlabs/puppetlabs-apache.git' author 'puppetlabs' license 'Apache 2.0' diff --git a/metadata.json b/metadata.json index 92663a43c..5fd476b7f 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-apache", - "version": "1.0.1", + "version": "1.1.0", "source": "https://github.com/puppetlabs/puppetlabs-apache", "author": "Puppet Labs", "license": "Apache-2.0", From 644cb9694db682880196a7ed10daf00fddb59f6e Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Wed, 21 May 2014 18:20:10 -0400 Subject: [PATCH 02/12] default shouldn't be quoted in the selector. --- spec/acceptance/apache_parameters_spec.rb | 4 ++-- spec/acceptance/class_spec.rb | 4 ++-- spec/acceptance/vhost_spec.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/acceptance/apache_parameters_spec.rb b/spec/acceptance/apache_parameters_spec.rb index 14e5a1b8e..019ad24de 100644 --- a/spec/acceptance/apache_parameters_spec.rb +++ b/spec/acceptance/apache_parameters_spec.rb @@ -331,8 +331,8 @@ class { 'apache': pp = <<-EOS if $::osfamily == 'RedHat' and $::selinux == 'true' { $semanage_package = $::operatingsystemmajrelease ? { - '5' => 'policycoreutils', - 'default' => 'policycoreutils-python', + '5' => 'policycoreutils', + default => 'policycoreutils-python', } package { $semanage_package: ensure => installed } diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index 830e3ed5b..bb41bf8f8 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -40,8 +40,8 @@ class { 'apache': } pp = <<-EOS if $::osfamily == 'RedHat' and $::selinux == 'true' { $semanage_package = $::operatingsystemmajrelease ? { - '5' => 'policycoreutils', - 'default' => 'policycoreutils-python', + '5' => 'policycoreutils', + default => 'policycoreutils-python', } package { $semanage_package: ensure => installed } diff --git a/spec/acceptance/vhost_spec.rb b/spec/acceptance/vhost_spec.rb index 34778cc04..7b229d1f5 100644 --- a/spec/acceptance/vhost_spec.rb +++ b/spec/acceptance/vhost_spec.rb @@ -1048,8 +1048,8 @@ class { 'apache::mod::fastcgi': } require => Package[$semanage_package], } $semanage_package = $::operatingsystemmajrelease ? { - '5' => 'policycoreutils', - 'default' => 'policycoreutils-python', + '5' => 'policycoreutils', + default => 'policycoreutils-python', } package { $semanage_package: ensure => installed } From 731329c8586c8af67203c3757a88af5a332fedfb Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Wed, 21 May 2014 19:23:51 -0400 Subject: [PATCH 03/12] Update PE version requirements. --- metadata.json | 1 + 1 file changed, 1 insertion(+) diff --git a/metadata.json b/metadata.json index 5fd476b7f..15317ff18 100644 --- a/metadata.json +++ b/metadata.json @@ -59,6 +59,7 @@ } ], "requirements": [ + { "name": "pe", "version_requirement": ">= 3.2.0 < 3.4.0" }, { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [] From 6a60fe48b1c8a2a813191cd9670258b559fc3c49 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Thu, 22 May 2014 18:56:04 -0400 Subject: [PATCH 04/12] Resolve test failures on apache. --- spec/acceptance/class_spec.rb | 17 ++++++++++------- spec/acceptance/mod_passenger_spec.rb | 10 +++++----- spec/acceptance/vhost_spec.rb | 9 ++++----- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index bb41bf8f8..a2899f6bf 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -46,15 +46,18 @@ class { 'apache': } package { $semanage_package: ensure => installed } exec { 'set_apache_defaults': - command => 'semanage fcontext -a -t httpd_sys_content_t "/apache_spec(/.*)?"', - path => '/bin:/usr/bin/:/sbin:/usr/sbin', - require => Package[$semanage_package], + command => 'semanage fcontext -a -t httpd_sys_content_t "/apache_spec(/.*)?"', + path => '/bin:/usr/bin/:/sbin:/usr/sbin', + subscribe => Package[$semanage_package], + refreshonly => true, } exec { 'restorecon_apache': - command => 'restorecon -Rv /apache_spec', - path => '/bin:/usr/bin/:/sbin:/usr/sbin', - before => Service['httpd'], - require => Class['apache'], + command => 'restorecon -Rv /apache_spec', + path => '/bin:/usr/bin/:/sbin:/usr/sbin', + before => Service['httpd'], + require => Class['apache'], + subscribe => Exec['set_apache_defaults'], + refreshonly => true, } } file { '/apache_spec': ensure => directory, } diff --git a/spec/acceptance/mod_passenger_spec.rb b/spec/acceptance/mod_passenger_spec.rb index 68622eecb..dd65c5d3e 100644 --- a/spec/acceptance/mod_passenger_spec.rb +++ b/spec/acceptance/mod_passenger_spec.rb @@ -81,7 +81,7 @@ class { 'apache::mod::passenger': } end it 'should output status via passenger-memory-stats' do - shell("sudo /usr/sbin/passenger-memory-stats") do |r| + shell("/usr/sbin/passenger-memory-stats") do |r| r.stdout.should =~ /Apache processes/ r.stdout.should =~ /Nginx processes/ r.stdout.should =~ /Passenger processes/ @@ -97,7 +97,7 @@ class { 'apache::mod::passenger': } unless fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemrelease') == '12.04' it 'should output status via passenger-status' do # xml output not available on ubunutu <= 10.04, so sticking with default pool output - shell("sudo /usr/sbin/passenger-status") do |r| + shell("/usr/sbin/passenger-status") do |r| # spacing may vary r.stdout.should =~ /[\-]+ General information [\-]+/ if fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemrelease') == '14.04' @@ -136,7 +136,7 @@ class { 'apache::mod::passenger': } /* EPEL and passenger repositories */ class { 'epel': } exec { 'passenger.repo GPG key': - command => '/usr/bin/sudo /usr/bin/curl -o /etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc', + command => '/usr/bin/curl -o /etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc', creates => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc', } file { 'passenger.repo GPG key': @@ -194,7 +194,7 @@ class { 'apache::mod::passenger': end it 'should output status via passenger-memory-stats' do - shell("sudo /usr/bin/passenger-memory-stats") do |r| + shell("/usr/bin/passenger-memory-stats") do |r| r.stdout.should =~ /Apache processes/ r.stdout.should =~ /Nginx processes/ r.stdout.should =~ /Passenger processes/ @@ -206,7 +206,7 @@ class { 'apache::mod::passenger': end it 'should output status via passenger-status' do - shell("sudo PASSENGER_TMPDIR=/var/run/rubygem-passenger /usr/bin/passenger-status") do |r| + shell("PASSENGER_TMPDIR=/var/run/rubygem-passenger /usr/bin/passenger-status") do |r| # spacing may vary r.stdout.should =~ /[\-]+ General information [\-]+/ r.stdout.should =~ /max[ ]+= [0-9]+/ diff --git a/spec/acceptance/vhost_spec.rb b/spec/acceptance/vhost_spec.rb index 7b229d1f5..c99e7d524 100644 --- a/spec/acceptance/vhost_spec.rb +++ b/spec/acceptance/vhost_spec.rb @@ -1042,16 +1042,15 @@ class { 'apache::mod::fastcgi': } it 'applies cleanly' do pp = <<-EOS if $::osfamily == 'RedHat' and $::selinux == 'true' { + $semanage_package = $::operatingsystemmajrelease ? { + '5' => 'policycoreutils', + default => 'policycoreutils-python', + } exec { 'set_apache_defaults': command => 'semanage fcontext -a -t httpd_sys_content_t "/apache_spec(/.*)?"', path => '/bin:/usr/bin/:/sbin:/usr/sbin', require => Package[$semanage_package], } - $semanage_package = $::operatingsystemmajrelease ? { - '5' => 'policycoreutils', - default => 'policycoreutils-python', - } - package { $semanage_package: ensure => installed } exec { 'restorecon_apache': command => 'restorecon -Rv /apache_spec', From a3632214e3e793d5199d015054715bf4e706630d Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Tue, 27 May 2014 12:48:45 -0400 Subject: [PATCH 05/12] Let's not hardcode x86_64... --- spec/acceptance/mod_pagespeed_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/acceptance/mod_pagespeed_spec.rb b/spec/acceptance/mod_pagespeed_spec.rb index de59a347c..2b5562729 100644 --- a/spec/acceptance/mod_pagespeed_spec.rb +++ b/spec/acceptance/mod_pagespeed_spec.rb @@ -33,7 +33,7 @@ class { 'apt': } } } elsif $::osfamily == 'RedHat' { yumrepo { 'mod-pagespeed': - baseurl => 'http://dl.google.com/linux/mod-pagespeed/rpm/stable/x86_64', + baseurl => "http://dl.google.com/linux/mod-pagespeed/rpm/stable/$::architecture", enabled => 1, gpgcheck => 1, gpgkey => 'https://dl-ssl.google.com/linux/linux_signing_key.pub', From a4f8c39509e4ef4b078d9f2ad4ca5277e2fc4922 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Thu, 29 May 2014 12:36:15 -0400 Subject: [PATCH 06/12] Only run mod_mime test on supported platforms. --- spec/acceptance/mod_mime_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/acceptance/mod_mime_spec.rb b/spec/acceptance/mod_mime_spec.rb index 71a7037a6..04b7dacc3 100644 --- a/spec/acceptance/mod_mime_spec.rb +++ b/spec/acceptance/mod_mime_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper_acceptance' -describe 'apache::mod::mime class' do +describe 'apache::mod::mime class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do case fact('osfamily') when 'Debian' mod_dir = '/etc/apache2/mods-available' From 22e660dca231526e4c9ff8c28f25c41119a6c4f7 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Fri, 30 May 2014 15:56:37 -0700 Subject: [PATCH 07/12] Fix passenger repo on Scientific linux Because passenger is lame and only provides repos for `$releasever` of 6, 6Server, and 6.0 through 6.3, but Scientific linux has a `$releasever` of `6.5` (rhel6 has `6Sverver`) --- spec/acceptance/mod_passenger_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/acceptance/mod_passenger_spec.rb b/spec/acceptance/mod_passenger_spec.rb index dd65c5d3e..085904975 100644 --- a/spec/acceptance/mod_passenger_spec.rb +++ b/spec/acceptance/mod_passenger_spec.rb @@ -151,9 +151,13 @@ class { 'epel': } File['passenger.repo GPG key'], ] } + $releasever_string = $operatingsystem ? { + 'Scientific' => '6', + default => '$releasever', + } yumrepo { 'passenger': - baseurl => 'http://passenger.stealthymonkeys.com/rhel/$releasever/$basearch' , - descr => 'Red Hat Enterprise $releasever - Phusion Passenger', + baseurl => "http://passenger.stealthymonkeys.com/rhel/${releasever_string}/\\$basearch" , + descr => "Red Hat Enterprise ${releasever_string} - Phusion Passenger", enabled => 1, gpgcheck => 1, gpgkey => 'http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc', From aa012cf397e5bc54c1fab6bb1755f826c7673e1f Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Mon, 9 Jun 2014 11:28:15 -0400 Subject: [PATCH 08/12] Pin rspec to 2.x. --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index 0ad4ddffc..ae7ff8c56 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,7 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org" group :development, :test do gem 'rake', '10.1.1', :require => false + gem 'rspec', '~> 2.11', :require => false gem 'rspec-puppet', '>=1.0.0', :require => false gem 'puppetlabs_spec_helper', :require => false gem 'serverspec', :require => false From 0925fc2991841c1d59bfcdc820eef2b9dcb4e830 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Mon, 9 Jun 2014 13:12:37 -0400 Subject: [PATCH 09/12] Delete gentoo a2mod tests. The tests are broken and we don't support gentoo, so deleting. --- spec/unit/provider/a2mod/gentoo_spec.rb | 184 ------------------------ 1 file changed, 184 deletions(-) delete mode 100644 spec/unit/provider/a2mod/gentoo_spec.rb diff --git a/spec/unit/provider/a2mod/gentoo_spec.rb b/spec/unit/provider/a2mod/gentoo_spec.rb deleted file mode 100644 index ddb9dddda..000000000 --- a/spec/unit/provider/a2mod/gentoo_spec.rb +++ /dev/null @@ -1,184 +0,0 @@ -#!/usr/bin/env rspec - -require 'spec_helper' - -provider_class = Puppet::Type.type(:a2mod).provider(:gentoo) - -describe provider_class do - before :each do - provider_class.clear - end - - [:conf_file, :instances, :modules, :initvars, :conf_file, :clear].each do |method| - it "should respond to the class method #{method}" do - provider_class.should respond_to(method) - end - end - - describe "when fetching modules" do - before do - @filetype = mock() - end - - it "should return a sorted array of the defined parameters" do - @filetype.expects(:read).returns(%Q{APACHE2_OPTS="-D FOO -D BAR -D BAZ"\n}) - provider_class.expects(:filetype).returns(@filetype) - - provider_class.modules.should == %w{bar baz foo} - end - - it "should cache the module list" do - @filetype.expects(:read).once.returns(%Q{APACHE2_OPTS="-D FOO -D BAR -D BAZ"\n}) - provider_class.expects(:filetype).once.returns(@filetype) - - 2.times { provider_class.modules.should == %w{bar baz foo} } - end - - it "should normalize parameters" do - @filetype.expects(:read).returns(%Q{APACHE2_OPTS="-D FOO -D BAR -D BAR"\n}) - provider_class.expects(:filetype).returns(@filetype) - - provider_class.modules.should == %w{bar foo} - end - end - - describe "when prefetching" do - it "should match providers to resources" do - provider = mock("ssl_provider", :name => "ssl") - resource = mock("ssl_resource") - resource.expects(:provider=).with(provider) - - provider_class.expects(:instances).returns([provider]) - provider_class.prefetch("ssl" => resource) - end - end - - describe "when flushing" do - before :each do - @filetype = mock() - @filetype.stubs(:backup) - provider_class.expects(:filetype).at_least_once.returns(@filetype) - - @info = mock() - @info.stubs(:[]).with(:name).returns("info") - @info.stubs(:provider=) - - @mpm = mock() - @mpm.stubs(:[]).with(:name).returns("mpm") - @mpm.stubs(:provider=) - - @ssl = mock() - @ssl.stubs(:[]).with(:name).returns("ssl") - @ssl.stubs(:provider=) - end - - it "should add modules whose ensure is present" do - @filetype.expects(:read).at_least_once.returns(%Q{APACHE2_OPTS=""}) - @filetype.expects(:write).with(%Q{APACHE2_OPTS="-D INFO"}) - - @info.stubs(:should).with(:ensure).returns(:present) - provider_class.prefetch("info" => @info) - - provider_class.flush - end - - it "should remove modules whose ensure is present" do - @filetype.expects(:read).at_least_once.returns(%Q{APACHE2_OPTS="-D INFO"}) - @filetype.expects(:write).with(%Q{APACHE2_OPTS=""}) - - @info.stubs(:should).with(:ensure).returns(:absent) - @info.stubs(:provider=) - provider_class.prefetch("info" => @info) - - provider_class.flush - end - - it "should not modify providers without resources" do - @filetype.expects(:read).at_least_once.returns(%Q{APACHE2_OPTS="-D INFO -D MPM"}) - @filetype.expects(:write).with(%Q{APACHE2_OPTS="-D MPM -D SSL"}) - - @info.stubs(:should).with(:ensure).returns(:absent) - provider_class.prefetch("info" => @info) - - @ssl.stubs(:should).with(:ensure).returns(:present) - provider_class.prefetch("ssl" => @ssl) - - provider_class.flush - end - - it "should write the modules in sorted order" do - @filetype.expects(:read).at_least_once.returns(%Q{APACHE2_OPTS=""}) - @filetype.expects(:write).with(%Q{APACHE2_OPTS="-D INFO -D MPM -D SSL"}) - - @mpm.stubs(:should).with(:ensure).returns(:present) - provider_class.prefetch("mpm" => @mpm) - @info.stubs(:should).with(:ensure).returns(:present) - provider_class.prefetch("info" => @info) - @ssl.stubs(:should).with(:ensure).returns(:present) - provider_class.prefetch("ssl" => @ssl) - - provider_class.flush - end - - it "should write the records back once" do - @filetype.expects(:read).at_least_once.returns(%Q{APACHE2_OPTS=""}) - @filetype.expects(:write).once.with(%Q{APACHE2_OPTS="-D INFO -D SSL"}) - - @info.stubs(:should).with(:ensure).returns(:present) - provider_class.prefetch("info" => @info) - - @ssl.stubs(:should).with(:ensure).returns(:present) - provider_class.prefetch("ssl" => @ssl) - - provider_class.flush - end - - it "should only modify the line containing APACHE2_OPTS" do - @filetype.expects(:read).at_least_once.returns(%Q{# Comment\nAPACHE2_OPTS=""\n# Another comment}) - @filetype.expects(:write).once.with(%Q{# Comment\nAPACHE2_OPTS="-D INFO"\n# Another comment}) - - @info.stubs(:should).with(:ensure).returns(:present) - provider_class.prefetch("info" => @info) - provider_class.flush - end - - it "should restore any arbitrary arguments" do - @filetype.expects(:read).at_least_once.returns(%Q{APACHE2_OPTS="-Y -D MPM -X"}) - @filetype.expects(:write).once.with(%Q{APACHE2_OPTS="-Y -X -D INFO -D MPM"}) - - @info.stubs(:should).with(:ensure).returns(:present) - provider_class.prefetch("info" => @info) - provider_class.flush - end - - it "should backup the file once if changes were made" do - @filetype.expects(:read).at_least_once.returns(%Q{APACHE2_OPTS=""}) - @filetype.expects(:write).once.with(%Q{APACHE2_OPTS="-D INFO -D SSL"}) - - @info.stubs(:should).with(:ensure).returns(:present) - provider_class.prefetch("info" => @info) - - @ssl.stubs(:should).with(:ensure).returns(:present) - provider_class.prefetch("ssl" => @ssl) - - @filetype.unstub(:backup) - @filetype.expects(:backup) - provider_class.flush - end - - it "should not write the file or run backups if no changes were made" do - @filetype.expects(:read).at_least_once.returns(%Q{APACHE2_OPTS="-X -D INFO -D SSL -Y"}) - @filetype.expects(:write).never - - @info.stubs(:should).with(:ensure).returns(:present) - provider_class.prefetch("info" => @info) - - @ssl.stubs(:should).with(:ensure).returns(:present) - provider_class.prefetch("ssl" => @ssl) - - @filetype.unstub(:backup) - @filetype.expects(:backup).never - provider_class.flush - end - end -end From a306c0c77f39c55661bf0f8048845f3b5c64e322 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Wed, 11 Jun 2014 14:22:28 -0400 Subject: [PATCH 10/12] Add test case for graceful failure on OSX. --- spec/classes/apache_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/classes/apache_spec.rb b/spec/classes/apache_spec.rb index 6e0b70533..429ab805b 100644 --- a/spec/classes/apache_spec.rb +++ b/spec/classes/apache_spec.rb @@ -540,4 +540,18 @@ it { should contain_apache__vhost('default-ssl').with_ensure('present') } end end + context 'with unsupported osfamily' do + let :facts do + { :osfamily => 'Darwin', + :operatingsystemrelease => '13.1.0', + :concat_basedir => '/dne', + } + end + + it do + expect { + should compile + }.to raise_error(Puppet::Error, /Unsupported osfamily/) + end + end end From b62bb06ae59933f2552e8e231db1829fb778e8cb Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Tue, 8 Jul 2014 15:36:17 -0400 Subject: [PATCH 11/12] Mark tests depending on passenger as pending on RHEL7. --- spec/acceptance/mod_passenger_spec.rb | 176 +++++++++++++------------- spec/acceptance/vhost_spec.rb | 44 ++++--- 2 files changed, 113 insertions(+), 107 deletions(-) diff --git a/spec/acceptance/mod_passenger_spec.rb b/spec/acceptance/mod_passenger_spec.rb index 085904975..a51fc9cd5 100644 --- a/spec/acceptance/mod_passenger_spec.rb +++ b/spec/acceptance/mod_passenger_spec.rb @@ -130,108 +130,110 @@ class { 'apache::mod::passenger': } # no fedora 18 passenger package yet, and rhel5 packages only exist for ruby 1.8.5 unless (fact('operatingsystem') == 'Fedora' and fact('operatingsystemrelease').to_f >= 18) or (fact('osfamily') == 'RedHat' and fact('operatingsystemmajrelease') == '5' and fact('rubyversion') != '1.8.5') - context "default passenger config" do - it 'succeeds in puppeting passenger' do - pp = <<-EOS - /* EPEL and passenger repositories */ - class { 'epel': } - exec { 'passenger.repo GPG key': - command => '/usr/bin/curl -o /etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc', - creates => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc', - } - file { 'passenger.repo GPG key': - ensure => file, - path => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc', - require => Exec['passenger.repo GPG key'], - } - epel::rpm_gpg_key { 'passenger.stealthymonkeys.com': - path => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc', - require => [ - Class['epel'], - File['passenger.repo GPG key'], - ] - } - $releasever_string = $operatingsystem ? { - 'Scientific' => '6', - default => '$releasever', - } - yumrepo { 'passenger': - baseurl => "http://passenger.stealthymonkeys.com/rhel/${releasever_string}/\\$basearch" , - descr => "Red Hat Enterprise ${releasever_string} - Phusion Passenger", - enabled => 1, - gpgcheck => 1, - gpgkey => 'http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc', - mirrorlist => 'http://passenger.stealthymonkeys.com/rhel/mirrors', - require => [ - Epel::Rpm_gpg_key['passenger.stealthymonkeys.com'], - ], - } - /* apache and mod_passenger */ - class { 'apache': + if fact('operatingsystem') == 'RedHat' and fact('operatingsystemmajrelease') == '7' + pending('test passenger - RHEL7 packages don\'t exist') + else + context "default passenger config" do + it 'succeeds in puppeting passenger' do + pp = <<-EOS + /* EPEL and passenger repositories */ + class { 'epel': } + exec { 'passenger.repo GPG key': + command => '/usr/bin/curl -o /etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc', + creates => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc', + } + file { 'passenger.repo GPG key': + ensure => file, + path => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc', + require => Exec['passenger.repo GPG key'], + } + epel::rpm_gpg_key { 'passenger.stealthymonkeys.com': + path => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc', require => [ Class['epel'], - ], - } - class { 'apache::mod::passenger': - require => [ - Yumrepo['passenger'] - ], - } - #{pp_rackapp} - EOS - apply_manifest(pp, :catch_failures => true) - end + File['passenger.repo GPG key'], + ] + } + $releasever_string = $operatingsystem ? { + 'Scientific' => '6', + default => '$releasever', + } + yumrepo { 'passenger': + baseurl => "http://passenger.stealthymonkeys.com/rhel/${releasever_string}/\\$basearch" , + descr => "Red Hat Enterprise ${releasever_string} - Phusion Passenger", + enabled => 1, + gpgcheck => 1, + gpgkey => 'http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc', + mirrorlist => 'http://passenger.stealthymonkeys.com/rhel/mirrors', + require => [ + Epel::Rpm_gpg_key['passenger.stealthymonkeys.com'], + ], + } + /* apache and mod_passenger */ + class { 'apache': + require => [ + Class['epel'], + ], + } + class { 'apache::mod::passenger': + require => [ + Yumrepo['passenger'] + ], + } + #{pp_rackapp} + EOS + apply_manifest(pp, :catch_failures => true) + end - describe service(service_name) do - it { should be_enabled } - it { should be_running } - end + describe service(service_name) do + it { should be_enabled } + it { should be_running } + end - describe file(conf_file) do - it { should contain "PassengerRoot #{passenger_root}" } - it { should contain "PassengerRuby #{passenger_ruby}" } - it { should contain "PassengerTempDir #{passenger_tempdir}" } - end + describe file(conf_file) do + it { should contain "PassengerRoot #{passenger_root}" } + it { should contain "PassengerRuby #{passenger_ruby}" } + it { should contain "PassengerTempDir #{passenger_tempdir}" } + end - describe file(load_file) do - it { should contain "LoadModule passenger_module #{passenger_module_path}" } - end + describe file(load_file) do + it { should contain "LoadModule passenger_module #{passenger_module_path}" } + end - it 'should output status via passenger-memory-stats' do - shell("/usr/bin/passenger-memory-stats") do |r| - r.stdout.should =~ /Apache processes/ - r.stdout.should =~ /Nginx processes/ - r.stdout.should =~ /Passenger processes/ - r.stdout.should =~ /### Processes: [0-9]+/ - r.stdout.should =~ /### Total private dirty RSS: [0-9\.]+ MB/ + it 'should output status via passenger-memory-stats' do + shell("/usr/bin/passenger-memory-stats") do |r| + r.stdout.should =~ /Apache processes/ + r.stdout.should =~ /Nginx processes/ + r.stdout.should =~ /Passenger processes/ + r.stdout.should =~ /### Processes: [0-9]+/ + r.stdout.should =~ /### Total private dirty RSS: [0-9\.]+ MB/ - r.exit_code.should == 0 + r.exit_code.should == 0 + end end - end - it 'should output status via passenger-status' do - shell("PASSENGER_TMPDIR=/var/run/rubygem-passenger /usr/bin/passenger-status") do |r| - # spacing may vary - r.stdout.should =~ /[\-]+ General information [\-]+/ - r.stdout.should =~ /max[ ]+= [0-9]+/ - r.stdout.should =~ /count[ ]+= [0-9]+/ - r.stdout.should =~ /active[ ]+= [0-9]+/ - r.stdout.should =~ /inactive[ ]+= [0-9]+/ - r.stdout.should =~ /Waiting on global queue: [0-9]+/ + it 'should output status via passenger-status' do + shell("PASSENGER_TMPDIR=/var/run/rubygem-passenger /usr/bin/passenger-status") do |r| + # spacing may vary + r.stdout.should =~ /[\-]+ General information [\-]+/ + r.stdout.should =~ /max[ ]+= [0-9]+/ + r.stdout.should =~ /count[ ]+= [0-9]+/ + r.stdout.should =~ /active[ ]+= [0-9]+/ + r.stdout.should =~ /inactive[ ]+= [0-9]+/ + r.stdout.should =~ /Waiting on global queue: [0-9]+/ - r.exit_code.should == 0 + r.exit_code.should == 0 + end end - end - it 'should answer to passenger.example.com' do - shell("/usr/bin/curl passenger.example.com:80") do |r| - r.stdout.should =~ /^hello world<\/b>$/ - r.exit_code.should == 0 + it 'should answer to passenger.example.com' do + shell("/usr/bin/curl passenger.example.com:80") do |r| + r.stdout.should =~ /^hello world<\/b>$/ + r.exit_code.should == 0 + end end end end - end - end end diff --git a/spec/acceptance/vhost_spec.rb b/spec/acceptance/vhost_spec.rb index c99e7d524..63309da52 100644 --- a/spec/acceptance/vhost_spec.rb +++ b/spec/acceptance/vhost_spec.rb @@ -814,29 +814,33 @@ class { 'apache': } # Passenger isn't even in EPEL on el-5 if default['platform'] !~ /^el-5/ - describe 'rack_base_uris' do - if fact('osfamily') == 'RedHat' - it 'adds epel' do - pp = "class { 'epel': }" - apply_manifest(pp, :catch_failures => true) + if fact('osfamily') == 'RedHat' and fact('operatingsystemmajrelease') == '7' + pending('Since we don\'t have passenger on RHEL7 rack_base_uris tests will fail') + else + describe 'rack_base_uris' do + if fact('osfamily') == 'RedHat' + it 'adds epel' do + pp = "class { 'epel': }" + apply_manifest(pp, :catch_failures => true) + end end - end - it 'applies cleanly' do - pp = <<-EOS - class { 'apache': } - host { 'test.server': ip => '127.0.0.1' } - apache::vhost { 'test.server': - docroot => '/tmp', - rack_base_uris => ['/test'], - } - EOS - apply_manifest(pp, :catch_failures => true) - end + it 'applies cleanly' do + pp = <<-EOS + class { 'apache': } + host { 'test.server': ip => '127.0.0.1' } + apache::vhost { 'test.server': + docroot => '/tmp', + rack_base_uris => ['/test'], + } + EOS + apply_manifest(pp, :catch_failures => true) + end - describe file("#{$vhost_dir}/25-test.server.conf") do - it { should be_file } - it { should contain 'RackBaseURI /test' } + describe file("#{$vhost_dir}/25-test.server.conf") do + it { should be_file } + it { should contain 'RackBaseURI /test' } + end end end end From eab15fba55e88f572462ada6c655e8744cdf2c32 Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Tue, 15 Jul 2014 11:45:52 -0400 Subject: [PATCH 12/12] Prepare a 1.1.1 release. --- CHANGELOG.md | 6 +++ Modulefile | 12 ----- metadata.json | 142 +++++++++++++++++++++++++++----------------------- 3 files changed, 84 insertions(+), 76 deletions(-) delete mode 100644 Modulefile diff --git a/CHANGELOG.md b/CHANGELOG.md index c77316a48..b598fdd2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +##2014-07-15 - Supported Release 1.1.1 +###Summary + +This release merely updates metadata.json so the module can be uninstalled and +upgraded via the puppet module command. + ## 2014-04-14 Supported Release 1.1.0 ###Summary diff --git a/Modulefile b/Modulefile deleted file mode 100644 index 49a712bcd..000000000 --- a/Modulefile +++ /dev/null @@ -1,12 +0,0 @@ -name 'puppetlabs-apache' -version '1.1.0' -source 'git://github.com/puppetlabs/puppetlabs-apache.git' -author 'puppetlabs' -license 'Apache 2.0' -summary 'Puppet module for Apache' -description 'Module for Apache configuration' -project_page 'https://github.com/puppetlabs/puppetlabs-apache' - -## Add dependencies, if any: -dependency 'puppetlabs/stdlib', '>= 2.4.0' -dependency 'puppetlabs/concat', '>= 1.0.0' diff --git a/metadata.json b/metadata.json index 15317ff18..f225f70e9 100644 --- a/metadata.json +++ b/metadata.json @@ -1,66 +1,80 @@ { - "name": "puppetlabs-apache", - "version": "1.1.0", - "source": "https://github.com/puppetlabs/puppetlabs-apache", - "author": "Puppet Labs", - "license": "Apache-2.0", - "project_page": "https://github.com/puppetlabs/puppetlabs-apache", - "summary": "Puppet module for Apache", - "operatingsystem_support": [ - { - "operatingsystem": "RedHat", - "operatingsystemrelease": [ - "5", - "6", - "7" - ] - }, - { - "operatingsystem": "CentOS", - "operatingsystemrelease": [ - "5", - "6", - "7" - - ] - }, - { - "operatingsystem": "OracleLinux", - "operatingsystemrelease": [ - "5", - "6", - "7" - - ] - }, - { - "operatingsystem": "Scientific", - "operatingsystemrelease": [ - "5", - "6", - "7" - - ] - }, - { - "operatingsystem": "Debian", - "operatingsystemrelease": [ - "6", - "7" - ] - }, - { - "operatingsystem": "Ubuntu", - "operatingsystemrelease": [ - "10.04", - "12.04", - "14.04" - ] - } - ], - "requirements": [ - { "name": "pe", "version_requirement": ">= 3.2.0 < 3.4.0" }, - { "name": "puppet", "version_requirement": "3.x" } - ], - "dependencies": [] + "name": "puppetlabs-apache", + "version": "1.1.1", + "author": "puppetlabs", + "summary": "Puppet module for Apache", + "license": "Apache 2.0", + "source": "git://github.com/puppetlabs/puppetlabs-apache.git", + "project_page": "https://github.com/puppetlabs/puppetlabs-apache", + "issues_url": "https://github.com/puppetlabs/puppetlabs-apache/issues", + "operatingsystem_support": [ + { + "operatingsystem": "RedHat", + "operatingsystemrelease": [ + "5", + "6", + "7" + ] + }, + { + "operatingsystem": "CentOS", + "operatingsystemrelease": [ + "5", + "6", + "7" + ] + }, + { + "operatingsystem": "OracleLinux", + "operatingsystemrelease": [ + "5", + "6", + "7" + ] + }, + { + "operatingsystem": "Scientific", + "operatingsystemrelease": [ + "5", + "6", + "7" + ] + }, + { + "operatingsystem": "Debian", + "operatingsystemrelease": [ + "6", + "7" + ] + }, + { + "operatingsystem": "Ubuntu", + "operatingsystemrelease": [ + "10.04", + "12.04", + "14.04" + ] + } + ], + "requirements": [ + { + "name": "pe", + "version_requirement": ">= 3.2.0 < 3.4.0" + }, + { + "name": "puppet", + "version_requirement": "3.x" + } + ], + "description": "Module for Apache configuration", + "dependencies": [ + { + "name": "puppetlabs/stdlib", + "version_requirement": ">= 2.4.0" + }, + { + "name": "puppetlabs/concat", + "version_requirement": ">= 1.0.0" + } + ] }