Skip to content

Commit

Permalink
Merge branch 'master' into php_value
Browse files Browse the repository at this point in the history
  • Loading branch information
jweisner committed Oct 25, 2014
2 parents adb90bf + bc56a5e commit 42b488f
Show file tree
Hide file tree
Showing 13 changed files with 169 additions and 118 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,8 @@ Creates URL [`rewrites`](#rewrites) rules in vhost directories. Expects an array
}
```

***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.

######`shib_request_setting`

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.
Expand Down
2 changes: 1 addition & 1 deletion manifests/custom_config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$content = undef,
$priority = '25',
$source = undef,
$verify_command = '/usr/sbin/apachectl -t',
$verify_command = $::apache::params::verify_command,
$verify_config = true,
) {

Expand Down
25 changes: 14 additions & 11 deletions manifests/mod/dav_svn.pp
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
class apache::mod::dav_svn (
$authz_svn_enabled = false,
) {
Class['::apache::mod::dav'] -> Class['::apache::mod::dav_svn']
include ::apache::mod::dav
::apache::mod { 'dav_svn': }
Class['::apache::mod::dav'] -> Class['::apache::mod::dav_svn']
include ::apache::mod::dav
::apache::mod { 'dav_svn': }

if $authz_svn_enabled {
::apache::mod { 'authz_svn':
loadfile_name => $::osfamily ? {
'Debian' => undef,
default => 'dav_svn_authz_svn.load',
},
require => Apache::Mod['dav_svn'],
}
if $::osfamily == 'Debian' and ($::operatingsystemmajrelease != '6' and $::operatingsystemmajrelease != '10.04') {
$loadfile_name = undef
} else {
$loadfile_name = 'dav_svn_authz_svn.load'
}

if $authz_svn_enabled {
::apache::mod { 'authz_svn':
loadfile_name => $loadfile_name,
require => Apache::Mod['dav_svn'],
}
}
}
10 changes: 9 additions & 1 deletion manifests/mod/fcgid.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
class apache::mod::fcgid(
$options = {},
) {
::apache::mod { 'fcgid': }
if $::osfamily == 'RedHat' and $::operatingsystemmajrelease == '7' {
$loadfile_name = 'unixd_fcgid.load'
} else {
$loadfile_name = undef
}

::apache::mod { 'fcgid':
loadfile_name => $loadfile_name
}

# Template uses:
# - $options
Expand Down
5 changes: 5 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
# The default error log level
$log_level = 'warn'

if $::operatingsystem == 'Ubuntu' and $::lsbdistrelease == '10.04' {
$verify_command = '/usr/sbin/apache2ctl -t'
} else {
$verify_command = '/usr/sbin/apachectl -t'
}
if $::osfamily == 'RedHat' or $::operatingsystem == 'amazon' {
$user = 'apache'
$group = 'apache'
Expand Down
10 changes: 6 additions & 4 deletions manifests/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -808,10 +808,12 @@
# - $passenger_min_instances
# - $passenger_start_timeout
# - $passenger_pre_start
concat::fragment { "${name}-passenger":
target => "${priority_real}-${filename}.conf",
order => 290,
content => template('apache/vhost/_passenger.erb'),
if $passenger_app_root or $passenger_ruby or $passenger_min_instances or $passenger_start_timeout or $passenger_pre_start {
concat::fragment { "${name}-passenger":
target => "${priority_real}-${filename}.conf",
order => 290,
content => template('apache/vhost/_passenger.erb'),
}
}

# Template uses:
Expand Down
1 change: 0 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"5",
"6",
"7"
]
Expand Down
8 changes: 6 additions & 2 deletions spec/acceptance/mod_dav_svn_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
require 'spec_helper_acceptance'

describe 'apache::mod::dav_svn class' do
describe 'apache::mod::dav_svn class', :unless => (fact('operatingsystem') == 'OracleLinux' and fact('operatingsystemmajrelease') == '7') do
case fact('osfamily')
when 'Debian'
mod_dir = '/etc/apache2/mods-available'
service_name = 'apache2'
authz_svn_load_file = 'authz_svn.load'
if fact('operatingsystemmajrelease') == '6' or fact('operatingsystemmajrelease') == '10.04'
authz_svn_load_file = 'dav_svn_authz_svn.load'
else
authz_svn_load_file = 'authz_svn.load'
end
when 'RedHat'
mod_dir = '/etc/httpd/conf.d'
service_name = 'httpd'
Expand Down
99 changes: 47 additions & 52 deletions spec/acceptance/mod_fcgid_spec.rb
Original file line number Diff line number Diff line change
@@ -1,62 +1,57 @@
require 'spec_helper_acceptance'

describe 'apache::mod::fcgid class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
case fact('osfamily')
when 'Debian'
# Not implemented
when 'RedHat'
context "default fcgid config" do
it 'succeeds in puppeting fcgid' do
pp = <<-EOS
class { 'epel': } # mod_fcgid lives in epel
class { 'apache': }
class { 'apache::mod::php': } # For /usr/bin/php-cgi
class { 'apache::mod::fcgid':
options => {
'FcgidIPCDir' => '/var/run/fcgidsock',
describe 'apache::mod::fcgid class', :unless => (UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) or (fact('operatingsystem') == 'OracleLinux' and fact('operatingsystemmajrelease') == '7')) do
context "default fcgid config", :if => (fact('osfamily') == 'RedHat' and fact('operatingsystemmajrelease') != '5') do
it 'succeeds in puppeting fcgid' do
pp = <<-EOS
class { 'epel': } # mod_fcgid lives in epel
class { 'apache': }
class { 'apache::mod::php': } # For /usr/bin/php-cgi
class { 'apache::mod::fcgid':
options => {
'FcgidIPCDir' => '/var/run/fcgidsock',
},
}
apache::vhost { 'fcgid.example.com':
port => '80',
docroot => '/var/www/fcgid',
directories => {
path => '/var/www/fcgid',
options => '+ExecCGI',
addhandlers => {
handler => 'fcgid-script',
extensions => '.php',
},
}
apache::vhost { 'fcgid.example.com':
port => '80',
docroot => '/var/www/fcgid',
directories => {
path => '/var/www/fcgid',
options => '+ExecCGI',
addhandlers => {
handler => 'fcgid-script',
extensions => '.php',
},
fcgiwrapper => {
command => '/usr/bin/php-cgi',
suffix => '.php',
}
},
}
file { '/var/www/fcgid/index.php':
ensure => file,
owner => 'root',
group => 'root',
content => "<?php echo 'Hello world'; ?>\\n",
}
EOS
apply_manifest(pp, :catch_failures => true)
end
fcgiwrapper => {
command => '/usr/bin/php-cgi',
suffix => '.php',
}
},
}
file { '/var/www/fcgid/index.php':
ensure => file,
owner => 'root',
group => 'root',
content => "<?php echo 'Hello world'; ?>\\n",
}
EOS
apply_manifest(pp, :catch_failures => true)
end

describe service('httpd') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
describe service('httpd') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end

it 'should answer to fcgid.example.com' do
shell("/usr/bin/curl -H 'Host: fcgid.example.com' 127.0.0.1:80") do |r|
expect(r.stdout).to match(/^Hello world$/)
expect(r.exit_code).to eq(0)
end
it 'should answer to fcgid.example.com' do
shell("/usr/bin/curl -H 'Host: fcgid.example.com' 127.0.0.1:80") do |r|
expect(r.stdout).to match(/^Hello world$/)
expect(r.exit_code).to eq(0)
end
end

it 'should run a php-cgi process' do
shell("pgrep -u apache php-cgi", :acceptable_exit_codes => [0])
end
it 'should run a php-cgi process' do
shell("pgrep -u apache php-cgi", :acceptable_exit_codes => [0])
end
end
end
4 changes: 2 additions & 2 deletions spec/acceptance/mod_passenger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,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|
expect(r.stdout).to match(/Apache processes/)
expect(r.stdout).to match(/Nginx processes/)
expect(r.stdout).to match(/Passenger processes/)
Expand Down Expand Up @@ -262,7 +262,7 @@ class { 'apache::mod::passenger':
end

it 'should output status via passenger-memory-stats' do
shell("sudo /usr/bin/passenger-memory-stats", :pty => true) do |r|
shell("/usr/bin/passenger-memory-stats", :pty => true) do |r|
expect(r.stdout).to match(/Apache processes/)
expect(r.stdout).to match(/Nginx processes/)
expect(r.stdout).to match(/Passenger processes/)
Expand Down
3 changes: 3 additions & 0 deletions spec/acceptance/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,9 @@ class { 'apache': }
pp = <<-EOS
class { 'apache': }
host { 'test.server': ip => '127.0.0.1' }
if ! defined(Class['apache::mod::rewrite']) {
include ::apache::mod::rewrite
}
apache::vhost { 'test.server':
docroot => '/tmp',
directories => [
Expand Down
47 changes: 25 additions & 22 deletions spec/classes/mod/dav_svn_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
context "on a Debian OS" do
let :facts do
{
:lsbdistcodename => 'squeeze',
:osfamily => 'Debian',
:operatingsystemrelease => '6',
:concat_basedir => '/dne',
:operatingsystem => 'Debian',
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:lsbdistcodename => 'squeeze',
:osfamily => 'Debian',
:operatingsystemrelease => '6',
:operatingsystemmajrelease => '6',
:concat_basedir => '/dne',
:operatingsystem => 'Debian',
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
it { is_expected.to contain_class("apache::params") }
Expand All @@ -24,13 +25,14 @@
context "on a RedHat OS" do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystemrelease => '6',
:concat_basedir => '/dne',
:operatingsystem => 'RedHat',
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:osfamily => 'RedHat',
:operatingsystemrelease => '6',
:operatingsystemmajrelease => '6',
:concat_basedir => '/dne',
:operatingsystem => 'RedHat',
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
it { is_expected.to contain_class("apache::params") }
Expand All @@ -40,13 +42,14 @@
context "on a FreeBSD OS" do
let :facts do
{
:osfamily => 'FreeBSD',
:operatingsystemrelease => '9',
:concat_basedir => '/dne',
:operatingsystem => 'FreeBSD',
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:osfamily => 'FreeBSD',
:operatingsystemrelease => '9',
:operatingsystemmajrelease => '9',
:concat_basedir => '/dne',
:operatingsystem => 'FreeBSD',
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
it { is_expected.to contain_class("apache::params") }
Expand Down
Loading

0 comments on commit 42b488f

Please sign in to comment.