Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: puppetlabs/puppetlabs-apache
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dde8570
Choose a base ref
...
head repository: puppetlabs/puppetlabs-apache
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 66d5ce9
Choose a head ref
  • 14 commits
  • 20 files changed
  • 2 contributors

Commits on Aug 22, 2012

  1. Fixed formatting in vhost template.

    Martin Dluhos committed Aug 22, 2012
    Copy the full SHA
    18bd200 View commit details

Commits on Aug 23, 2012

  1. Fixed syntax of validate_re function.

    Martin Dluhos committed Aug 23, 2012
    Copy the full SHA
    9cd964d View commit details
  2. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    8c95c76 View commit details
  3. Merge pull request #87 from martasd/fix-validate

    Fixed syntax of validate_re function.
    hunner committed Aug 23, 2012

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    1e6e8e6 View commit details

Commits on Aug 24, 2012

  1. Updating spec coverage for new defines

    - Functionality of the apache module depends on the existence of either
      `$osfamily` or `$operatingsystem`. The tests now reflect this.
    - The class `apache` is no longer tested for inclusion in `apache::mod`
      because of a bug in puppet-rspec which creates duplicate resources.
    - Most of the test coverage is for existing code on the `Debian`
      `$osfamily` as per the the pre-existing design. `RedHat` coverage has
      been added on a few specific counts.
    hunner committed Aug 24, 2012

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    78208d8 View commit details
  2. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    b1566b6 View commit details
  3. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    118a5aa View commit details
  4. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    7082a2a View commit details
  5. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    c1a3c92 View commit details
  6. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    ec83e55 View commit details
  7. Merge pull request #83 from hunner/fix_failing_spec_tests

    Fix failing spec tests
    
    reviewed-by: branan@puppetlabs.com
    hunner committed Aug 24, 2012

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    9715a20 View commit details
  8. Merge pull request #88 from hunner/fix-vhost-template

    Fix vhost template
    
    reviewed-by: branan@puppetlabs.com
    hunner committed Aug 24, 2012

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    147b75c View commit details
  9. Release 0.4.0

    Changes:
    - `include apache` is now required when using apache::mod::*
    
    Bugfixes:
    - Fix syntax for validate_re
    - Fix formatting in vhost template
    - Fix spec tests such that they pass
    hunner committed Aug 24, 2012

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    0685f22 View commit details
  10. Merge pull request #90 from hunner/release_0.4.0

    Release 0.4.0
    hunner committed Aug 24, 2012

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    66d5ce9 View commit details
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2012-08-24 Release 0.4.0
Changes:
- `include apache` is now required when using apache::mod::*

Bugfixes:
- Fix syntax for validate_re
- Fix formatting in vhost template
- Fix spec tests such that they pass

2012-05-08 Puppet Labs <info@puppetlabs.com> - 0.0.4
e62e362 Fix broken tests for ssl, vhost, vhost::*
42c6363 Changes to match style guide and pass puppet-lint without error
2 changes: 1 addition & 1 deletion Modulefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name 'puppetlabs-apache'
version '0.3.0'
version '0.4.0'
source 'git://github.com/puppetlabs/puppetlabs-apache.git'
author 'puppetlabs'
license 'Apache 2.0'
19 changes: 11 additions & 8 deletions manifests/mod.pp
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
define apache::mod (
$package = undef
) {
$module = $name
include apache
$mod = $name
include apache::params
#include apache #This creates duplicate resources in rspec-puppet
$mod_packages = $apache::params::mod_packages
$mod_package = $mod_packages[$mod] # 2.6 compatibility hack
if $package {
$package_REAL = $package
} elsif $mod_packages[$module] {
$package_REAL = $mod_packages[$module]
} elsif "$mod_package" {
$package_REAL = $mod_package
}
$mod_libs = $apache::params::mod_libs
if $mod_libs {
$lib = $mod_libs[$module]
$mod_lib = $mod_libs[$mod] # 2.6 compatibility hack
if "${mod_lib}" {
$lib = $mod_lib
}

if $package_REAL {
package { $package_REAL:
ensure => present,
require => Package['httpd'],
before => A2mod[$module],
before => A2mod[$mod],
}
}

a2mod { $module:
a2mod { $mod:
ensure => present,
lib => $lib,
require => Package['httpd'],
12 changes: 2 additions & 10 deletions manifests/mod/python.pp
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
class apache::mod::python {
include apache

package { 'mod_python_package':
ensure => installed,
name => $apache::params::mod_python_package,
require => Package['httpd'];
}

a2mod { 'python': ensure => present; }

#include apache
apache::mod { 'python': }
}


13 changes: 2 additions & 11 deletions manifests/params.pp
Original file line number Diff line number Diff line change
@@ -77,17 +77,8 @@
'python' => 'libapache2-mod-python',
'wsgi' => 'libapache2-mod-wsgi',
}
$mod_libs = {}
} else {
$user = 'www-data'
$group = 'www-data'
$apache_name = 'apache2'
$php_package = 'libapache2-mod-php5'
$mod_python_package = 'libapache2-mod-python'
$mod_wsgi_package = 'libapache2-mod-wsgi'
$mod_auth_kerb_package = 'libapache2-mod-auth-kerb'
$ssl_package = 'apache-ssl'
$apache_dev = 'apache-dev'
$vdir = '/etc/apache2/sites-enabled/'
$proxy_modules = ['proxy', 'proxy_http']
fail("Class['apache::params']: Unsupported operatingsystem: $operatingsystem")
}
}
2 changes: 1 addition & 1 deletion manifests/vhost.pp
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@
$ensure = 'present'
) {

validate_re($ensure, [ '^present$', '^absent$' ],
validate_re($ensure, '^(present|absent)$',
"${ensure} is not supported for ensure.
Allowed values are 'present' and 'absent'.")

62 changes: 42 additions & 20 deletions spec/classes/apache_spec.rb
Original file line number Diff line number Diff line change
@@ -1,24 +1,46 @@
require 'spec_helper'

describe 'apache', :type => :class do

it { should include_class("apache::params") }

it { should contain_package("httpd") }

it { should contain_service("httpd").with(
'ensure' => 'running',
'enable' => 'true',
'subscribe' => 'Package[httpd]'
)
}

it { should contain_file("httpd_vdir").with(
'ensure' => 'directory',
'recurse' => 'true',
'purge' => 'true',
'notify' => 'Service[httpd]',
'require' => 'Package[httpd]'
)
}
context "On a Debian OS" do
let :facts do
{ :osfamily => 'Debian' }
end
it { should include_class("apache::params") }
it { should contain_package("httpd") }
it { should contain_service("httpd").with(
'ensure' => 'running',
'enable' => 'true',
'subscribe' => 'Package[httpd]'
)
}
it { should contain_file("httpd_vdir").with(
'ensure' => 'directory',
'recurse' => 'true',
'purge' => 'true',
'notify' => 'Service[httpd]',
'require' => 'Package[httpd]'
)
}
end
context "On a RedHat OS" do
let :facts do
{ :osfamily => 'RedHat' }
end
it { should include_class("apache::params") }
it { should contain_package("httpd") }
it { should contain_service("httpd").with(
'ensure' => 'running',
'enable' => 'true',
'subscribe' => 'Package[httpd]'
)
}
it { should contain_file("httpd_vdir").with(
'ensure' => 'directory',
'recurse' => 'true',
'purge' => 'true',
'notify' => 'Service[httpd]',
'require' => 'Package[httpd]'
)
}
end
end
24 changes: 20 additions & 4 deletions spec/classes/dev_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
require 'spec_helper'

describe 'apache::dev', :type => :class do

it { should include_class("apache::params") }
it { should contain_package("apache_dev_package") }

context "On a Debian OS" do
let :facts do
{ :osfamily => 'Debian' }
end
it {
should include_class("apache::params")
should contain_package("libaprutil1-dev")
should contain_package("libapr1-dev")
should contain_package("apache2-prefork-dev")
}
end
context "On a RedHat OS" do
let :facts do
{ :osfamily => 'RedHat' }
end
it {
should include_class("apache::params")
should contain_package("httpd-devel")
}
end
end
27 changes: 14 additions & 13 deletions spec/classes/mod/auth_kerb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
require 'spec_helper'

describe 'apache::mod::auth_kerb', :type => :class do

it { should include_class("apache") }

it { should contain_package("mod_auth_kerb_package").with(
'require' => 'Package[httpd]'
)
}

it { should contain_a2mod("auth_kerb").with(
'ensure' => 'present'
)
}

context "On a Debian OS" do
let :facts do
{ :osfamily => 'Debian' }
end
it { should include_class("apache") }
it { should contain_package("mod_auth_kerb_package").with(
'require' => 'Package[httpd]'
)
}
it { should contain_a2mod("auth_kerb").with(
'ensure' => 'present'
)
}
end
end
35 changes: 21 additions & 14 deletions spec/classes/mod/python_spec.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
require 'spec_helper'

describe 'apache::mod::python', :type => :class do

it { should include_class("apache") }

it { should contain_package("mod_python_package").with(
'ensure' => 'installed',
'require' => 'Package[httpd]'
)
}

it { should contain_a2mod("python").with(
'ensure' => 'present'
)
}

context "On a Debian OS" do
let :facts do
{ :osfamily => 'Debian' }
end
it { should include_class("apache::params") }
it { should contain_package("libapache2-mod-python").with(
'ensure' => 'present',
'require' => 'Package[httpd]'
) }
it { should contain_a2mod("python") }
end
context "On a RedHat OS" do
let :facts do
{ :osfamily => 'RedHat' }
end
it { should include_class("apache::params") }
it { should contain_package("mod_python") }
it { should contain_a2mod("python").with(
'ensure' => 'present'
) }
end
end
22 changes: 22 additions & 0 deletions spec/classes/mod/ssl_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require 'spec_helper'

describe 'apache::mod::ssl', :type => :class do
describe 'when running on an unsupported OS' do
let(:facts) { {:operatingsystem => 'MagicUnicorn', :osfamily => 'Magic'} }
it { expect { should raise_error(Puppet::Error, "Unsupported operatingsystem:") } }
end

describe 'when running on redhat' do
let(:facts) { {:operatingsystem => 'redhat', :osfamily => 'redhat'} }
it { should include_class('apache::params') }
it { should contain_package('mod_ssl') }
it { should contain_a2mod('ssl') }
end

describe 'when running on debian' do
let(:facts) { {:operatingsystem => 'debian', :osfamily => 'debian'} }
it { should include_class('apache::params') }
it { should_not contain_package('libapache2-mod-ssl') }
it { should contain_a2mod('ssl') }
end
end
26 changes: 13 additions & 13 deletions spec/classes/mod/wsgi_spec.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
require 'spec_helper'

describe 'apache::mod::wsgi', :type => :class do

it { should include_class("apache") }

it { should contain_package("mod_wsgi_package").with(
'require' => 'Package[httpd]'
)
}

it { should contain_a2mod("wsgi").with(
'ensure' => 'present'
)
}

context "On a Debian OS" do
let :facts do
{ :osfamily => 'Debian' }
end
it { should include_class("apache") }
it { should contain_package("mod_wsgi_package").with(
'require' => 'Package[httpd]'
) }
it { should contain_a2mod("wsgi").with(
'ensure' => 'present'
)
}
end
end
18 changes: 11 additions & 7 deletions spec/classes/params_spec.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
require 'spec_helper'

describe 'apache::params', :type => :class do
context "On a Debian OS" do
let :facts do
{ :osfamily => 'Debian' }
end
it { should contain_apache__params }

it { should contain_apache__params }

# There are 4 resources in this class currently
# there should not be any more resources because it is a params class
# The resources are class[apache::params], class[main], class[settings], stage[main]
it "Should not contain any resources" do
subject.resources.size.should == 4
# There are 4 resources in this class currently
# there should not be any more resources because it is a params class
# The resources are class[apache::params], class[main], class[settings], stage[main]
it "Should not contain any resources" do
subject.resources.size.should == 4
end
end
end
21 changes: 19 additions & 2 deletions spec/classes/php_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
require 'spec_helper'

describe 'apache::php', :type => :class do
context "On a Debian OS" do
let :facts do
{ :osfamily => 'Debian' }
end
it { should include_class("apache::params") }
it { should contain_apache__mod("php5") }
it { should contain_package("libapache2-mod-php5") }
end

it { should include_class("apache::params") }
it { should contain_package("apache_php_package") }
context "On a RedHat OS" do
let :facts do
{ :osfamily => 'RedHat' }
end
it { should include_class("apache::params") }
it { should contain_apache__mod("php5") }
it { should contain_package("php") }
end

context "On undefined OS" do
it { expect { should raise_error(Puppet::Error) } }
end
end
Loading