Skip to content

Commit 62f26fd

Browse files
committed
Merge pull request #916 from mhaskel/test
Merge 1.2.x into master
2 parents 0b0a226 + 1f9aaad commit 62f26fd

File tree

12 files changed

+163
-114
lines changed

12 files changed

+163
-114
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,6 +1745,8 @@ Creates URL [`rewrites`](#rewrites) rules in vhost directories. Expects an array
17451745
}
17461746
```
17471747

1748+
***Note*** If you include rewrites in your directories make sure you are also including `apache::mod::rewrite`. You may also want to consider setting the rewrites using the `rewrites` parameter in `apache::vhost` rather than setting the rewrites in the vhost directories.
1749+
17481750
######`shib_request_setting`
17491751

17501752
Allows an valid content setting to be set or altered for the application request. This command takes two parameters, the name of the content setting, and the value to set it to.Check the Shibboleth [content setting documentation](https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPContentSettings) for valid settings. This key is disabled if `apache::mod::shib` is not defined. Check the [`mod_shib` documentation](https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPApacheConfig#NativeSPApacheConfig-Server/VirtualHostOptions) for more details.

manifests/custom_config.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
$content = undef,
66
$priority = '25',
77
$source = undef,
8-
$verify_command = '/usr/sbin/apachectl -t',
8+
$verify_command = $::apache::params::verify_command,
99
$verify_config = true,
1010
) {
1111

manifests/mod/dav_svn.pp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
class apache::mod::dav_svn (
22
$authz_svn_enabled = false,
33
) {
4-
Class['::apache::mod::dav'] -> Class['::apache::mod::dav_svn']
5-
include ::apache::mod::dav
6-
::apache::mod { 'dav_svn': }
4+
Class['::apache::mod::dav'] -> Class['::apache::mod::dav_svn']
5+
include ::apache::mod::dav
6+
::apache::mod { 'dav_svn': }
77

8-
if $authz_svn_enabled {
9-
::apache::mod { 'authz_svn':
10-
loadfile_name => $::osfamily ? {
11-
'Debian' => undef,
12-
default => 'dav_svn_authz_svn.load',
13-
},
14-
require => Apache::Mod['dav_svn'],
15-
}
8+
if $::osfamily == 'Debian' and ($::operatingsystemmajrelease != '6' and $::operatingsystemmajrelease != '10.04') {
9+
$loadfile_name = undef
10+
} else {
11+
$loadfile_name = 'dav_svn_authz_svn.load'
12+
}
13+
14+
if $authz_svn_enabled {
15+
::apache::mod { 'authz_svn':
16+
loadfile_name => $loadfile_name,
17+
require => Apache::Mod['dav_svn'],
1618
}
19+
}
1720
}

manifests/mod/fcgid.pp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
class apache::mod::fcgid(
22
$options = {},
33
) {
4-
::apache::mod { 'fcgid': }
4+
if $::osfamily == 'RedHat' and $::operatingsystemmajrelease == '7' {
5+
$loadfile_name = 'unixd_fcgid.load'
6+
} else {
7+
$loadfile_name = undef
8+
}
9+
10+
::apache::mod { 'fcgid':
11+
loadfile_name => $loadfile_name
12+
}
513

614
# Template uses:
715
# - $options

manifests/params.pp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
# The default error log level
2929
$log_level = 'warn'
3030

31+
if $::operatingsystem == 'Ubuntu' and $::lsbdistrelease == '10.04' {
32+
$verify_command = '/usr/sbin/apache2ctl -t'
33+
} else {
34+
$verify_command = '/usr/sbin/apachectl -t'
35+
}
3136
if $::osfamily == 'RedHat' or $::operatingsystem == 'amazon' {
3237
$user = 'apache'
3338
$group = 'apache'

metadata.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
{
2828
"operatingsystem": "OracleLinux",
2929
"operatingsystemrelease": [
30-
"5",
3130
"6",
3231
"7"
3332
]

spec/acceptance/mod_dav_svn_spec.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
require 'spec_helper_acceptance'
22

3-
describe 'apache::mod::dav_svn class' do
3+
describe 'apache::mod::dav_svn class', :unless => (fact('operatingsystem') == 'OracleLinux' and fact('operatingsystemmajrelease') == '7') do
44
case fact('osfamily')
55
when 'Debian'
66
mod_dir = '/etc/apache2/mods-available'
77
service_name = 'apache2'
8-
authz_svn_load_file = 'authz_svn.load'
8+
if fact('operatingsystemmajrelease') == '6' or fact('operatingsystemmajrelease') == '10.04'
9+
authz_svn_load_file = 'dav_svn_authz_svn.load'
10+
else
11+
authz_svn_load_file = 'authz_svn.load'
12+
end
913
when 'RedHat'
1014
mod_dir = '/etc/httpd/conf.d'
1115
service_name = 'httpd'

spec/acceptance/mod_fcgid_spec.rb

Lines changed: 47 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,57 @@
11
require 'spec_helper_acceptance'
22

3-
describe 'apache::mod::fcgid class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
4-
case fact('osfamily')
5-
when 'Debian'
6-
# Not implemented
7-
when 'RedHat'
8-
context "default fcgid config" do
9-
it 'succeeds in puppeting fcgid' do
10-
pp = <<-EOS
11-
class { 'epel': } # mod_fcgid lives in epel
12-
class { 'apache': }
13-
class { 'apache::mod::php': } # For /usr/bin/php-cgi
14-
class { 'apache::mod::fcgid':
15-
options => {
16-
'FcgidIPCDir' => '/var/run/fcgidsock',
3+
describe 'apache::mod::fcgid class', :unless => (UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) or (fact('operatingsystem') == 'OracleLinux' and fact('operatingsystemmajrelease') == '7')) do
4+
context "default fcgid config", :if => (fact('osfamily') == 'RedHat' and fact('operatingsystemmajrelease') != '5') do
5+
it 'succeeds in puppeting fcgid' do
6+
pp = <<-EOS
7+
class { 'epel': } # mod_fcgid lives in epel
8+
class { 'apache': }
9+
class { 'apache::mod::php': } # For /usr/bin/php-cgi
10+
class { 'apache::mod::fcgid':
11+
options => {
12+
'FcgidIPCDir' => '/var/run/fcgidsock',
13+
},
14+
}
15+
apache::vhost { 'fcgid.example.com':
16+
port => '80',
17+
docroot => '/var/www/fcgid',
18+
directories => {
19+
path => '/var/www/fcgid',
20+
options => '+ExecCGI',
21+
addhandlers => {
22+
handler => 'fcgid-script',
23+
extensions => '.php',
1724
},
18-
}
19-
apache::vhost { 'fcgid.example.com':
20-
port => '80',
21-
docroot => '/var/www/fcgid',
22-
directories => {
23-
path => '/var/www/fcgid',
24-
options => '+ExecCGI',
25-
addhandlers => {
26-
handler => 'fcgid-script',
27-
extensions => '.php',
28-
},
29-
fcgiwrapper => {
30-
command => '/usr/bin/php-cgi',
31-
suffix => '.php',
32-
}
33-
},
34-
}
35-
file { '/var/www/fcgid/index.php':
36-
ensure => file,
37-
owner => 'root',
38-
group => 'root',
39-
content => "<?php echo 'Hello world'; ?>\\n",
40-
}
41-
EOS
42-
apply_manifest(pp, :catch_failures => true)
43-
end
25+
fcgiwrapper => {
26+
command => '/usr/bin/php-cgi',
27+
suffix => '.php',
28+
}
29+
},
30+
}
31+
file { '/var/www/fcgid/index.php':
32+
ensure => file,
33+
owner => 'root',
34+
group => 'root',
35+
content => "<?php echo 'Hello world'; ?>\\n",
36+
}
37+
EOS
38+
apply_manifest(pp, :catch_failures => true)
39+
end
4440

45-
describe service('httpd') do
46-
it { is_expected.to be_enabled }
47-
it { is_expected.to be_running }
48-
end
41+
describe service('httpd') do
42+
it { is_expected.to be_enabled }
43+
it { is_expected.to be_running }
44+
end
4945

50-
it 'should answer to fcgid.example.com' do
51-
shell("/usr/bin/curl -H 'Host: fcgid.example.com' 127.0.0.1:80") do |r|
52-
expect(r.stdout).to match(/^Hello world$/)
53-
expect(r.exit_code).to eq(0)
54-
end
46+
it 'should answer to fcgid.example.com' do
47+
shell("/usr/bin/curl -H 'Host: fcgid.example.com' 127.0.0.1:80") do |r|
48+
expect(r.stdout).to match(/^Hello world$/)
49+
expect(r.exit_code).to eq(0)
5550
end
51+
end
5652

57-
it 'should run a php-cgi process' do
58-
shell("pgrep -u apache php-cgi", :acceptable_exit_codes => [0])
59-
end
53+
it 'should run a php-cgi process' do
54+
shell("pgrep -u apache php-cgi", :acceptable_exit_codes => [0])
6055
end
6156
end
6257
end

spec/acceptance/mod_passenger_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class { 'apache::mod::passenger': }
137137
end
138138

139139
it 'should output status via passenger-memory-stats' do
140-
shell("sudo /usr/sbin/passenger-memory-stats") do |r|
140+
shell("/usr/sbin/passenger-memory-stats") do |r|
141141
expect(r.stdout).to match(/Apache processes/)
142142
expect(r.stdout).to match(/Nginx processes/)
143143
expect(r.stdout).to match(/Passenger processes/)
@@ -262,7 +262,7 @@ class { 'apache::mod::passenger':
262262
end
263263

264264
it 'should output status via passenger-memory-stats' do
265-
shell("sudo /usr/bin/passenger-memory-stats", :pty => true) do |r|
265+
shell("/usr/bin/passenger-memory-stats", :pty => true) do |r|
266266
expect(r.stdout).to match(/Apache processes/)
267267
expect(r.stdout).to match(/Nginx processes/)
268268
expect(r.stdout).to match(/Passenger processes/)

spec/acceptance/vhost_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,9 @@ class { 'apache': }
991991
pp = <<-EOS
992992
class { 'apache': }
993993
host { 'test.server': ip => '127.0.0.1' }
994+
if ! defined(Class['apache::mod::rewrite']) {
995+
include ::apache::mod::rewrite
996+
}
994997
apache::vhost { 'test.server':
995998
docroot => '/tmp',
996999
directories => [

0 commit comments

Comments
 (0)