X-Git-Url: https://git.donarmstrong.com/?p=dsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fapache%2Fmanifests%2Fpackage.pp;fp=3rdparty%2Fmodules%2Fapache%2Fmanifests%2Fpackage.pp;h=728b26010e312e3613658ad63266aca4bed5dbf8;hp=0000000000000000000000000000000000000000;hb=4631045ebb77ee8622f6fa09277a50c372bcc02e;hpb=3d4dc4fd9e59bd0e07646c99f6b356c7d9d859aa diff --git a/3rdparty/modules/apache/manifests/package.pp b/3rdparty/modules/apache/manifests/package.pp new file mode 100644 index 00000000..728b2601 --- /dev/null +++ b/3rdparty/modules/apache/manifests/package.pp @@ -0,0 +1,65 @@ +class apache::package ( + $ensure = 'present', + $mpm_module = $::apache::params::mpm_module, +) inherits ::apache::params { + + # The base class must be included first because it is used by parameter defaults + if ! defined(Class['apache']) { + fail('You must include the apache base class before using any apache defined resources') + } + + case $::osfamily { + 'FreeBSD': { + case $mpm_module { + 'prefork': { + $set = 'MPM_PREFORK' + $unset = 'MPM_WORKER MPM_EVENT' + } + 'worker': { + $set = 'MPM_WORKER' + $unset = 'MPM_PERFORK MPM_EVENT' + } + 'event': { + $set = 'MPM_EVENT' + $unset = 'MPM_PERFORK MPM_WORKER' + } + 'itk': { + $set = undef + $unset = undef + package { 'www/mod_mpm_itk': + ensure => installed, + } + } + default: { fail("MPM module ${mpm_module} not supported on FreeBSD") } + } + + # Configure ports to have apache build options set correctly + if $set { + file_line { 'apache SET options in /etc/make.conf': + ensure => $ensure, + path => '/etc/make.conf', + line => "apache24_SET_FORCE=${set}", + match => '^apache24_SET_FORCE=.*', + before => Package['httpd'], + } + file_line { 'apache UNSET options in /etc/make.conf': + ensure => $ensure, + path => '/etc/make.conf', + line => "apache24_UNSET_FORCE=${unset}", + match => '^apache24_UNSET_FORCE=.*', + before => Package['httpd'], + } + } + $apache_package = $::apache::apache_name + } + default: { + $apache_package = $::apache::apache_name + } + } + + package { 'httpd': + ensure => $ensure, + name => $apache_package, + notify => Class['Apache::Service'], + } +}