Skip to content

Commit

Permalink
Merge pull request #879 from mhaskel/fcgid_fix
Browse files Browse the repository at this point in the history
Need fcgid to load after unixd on RHEL7
  • Loading branch information
hunner committed Sep 30, 2014
2 parents 033dfec + 9715ac0 commit 01aff84
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 23 deletions.
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
71 changes: 49 additions & 22 deletions spec/classes/mod/fcgid_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
context "on a Debian OS" do
let :facts do
{
:osfamily => 'Debian',
:operatingsystemrelease => '6',
:concat_basedir => '/dne',
:lsbdistcodename => 'squeeze',
:operatingsystem => 'Debian',
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:osfamily => 'Debian',
:operatingsystemrelease => '6',
:operatingsystemmajrelease => '6',
:concat_basedir => '/dne',
:lsbdistcodename => 'squeeze',
: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 @@ -26,13 +27,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

Expand Down Expand Up @@ -66,16 +68,41 @@
end
end

context "on RHEL7" do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystemrelease => '7',
:operatingsystemmajrelease => '7',
:concat_basedir => '/dne',
:operatingsystem => 'RedHat',
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end

describe 'without parameters' do
it { is_expected.to contain_class("apache::params") }
it { is_expected.to contain_apache__mod('fcgid').with({
'loadfile_name' => 'unixd_fcgid.load'
})
}
it { is_expected.to contain_package("mod_fcgid") }
end
end

context "on a FreeBSD OS" do
let :facts do
{
:osfamily => 'FreeBSD',
:operatingsystemrelease => '9',
:concat_basedir => '/dne',
:operatingsystem => 'FreeBSD',
:id => 'root',
:kernel => 'FreeBSD',
: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 => 'FreeBSD',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end

Expand Down

0 comments on commit 01aff84

Please sign in to comment.