X-Git-Url: https://git.donarmstrong.com/?p=dsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fapache%2Fmanifests%2Fmod%2Fphp.pp;fp=3rdparty%2Fmodules%2Fapache%2Fmanifests%2Fmod%2Fphp.pp;h=1d1274f3b4257d2335aa4159d6992be0c6bb7bc2;hp=0000000000000000000000000000000000000000;hb=29c25a2dd54b818d590063af535221f98af7d6c8;hpb=943dd63ceab3c595cfdff25de2631d5b74f19dc9 diff --git a/3rdparty/modules/apache/manifests/mod/php.pp b/3rdparty/modules/apache/manifests/mod/php.pp new file mode 100644 index 00000000..1d1274f3 --- /dev/null +++ b/3rdparty/modules/apache/manifests/mod/php.pp @@ -0,0 +1,62 @@ +class apache::mod::php ( + $package_name = undef, + $package_ensure = 'present', + $path = undef, + $extensions = ['.php'], + $content = undef, + $template = 'apache/mod/php5.conf.erb', + $source = undef, + $root_group = $::apache::params::root_group, +) inherits apache::params { + + if defined(Class['::apache::mod::prefork']) { + Class['::apache::mod::prefork']->File['php5.conf'] + } + elsif defined(Class['::apache::mod::itk']) { + Class['::apache::mod::itk']->File['php5.conf'] + } + else { + fail('apache::mod::php requires apache::mod::prefork or apache::mod::itk; please enable mpm_module => \'prefork\' or mpm_module => \'itk\' on Class[\'apache\']') + } + validate_array($extensions) + + if $source and ($content or $template != 'apache/mod/php5.conf.erb') { + warning('source and content or template parameters are provided. source parameter will be used') + } elsif $content and $template != 'apache/mod/php5.conf.erb' { + warning('content and template parameters are provided. content parameter will be used') + } + + $manage_content = $source ? { + undef => $content ? { + undef => template($template), + default => $content, + }, + default => undef, + } + + ::apache::mod { 'php5': + package => $package_name, + package_ensure => $package_ensure, + path => $path, + } + + include ::apache::mod::mime + include ::apache::mod::dir + Class['::apache::mod::mime'] -> Class['::apache::mod::dir'] -> Class['::apache::mod::php'] + + # Template uses $extensions + file { 'php5.conf': + ensure => file, + path => "${::apache::mod_dir}/php5.conf", + owner => 'root', + group => $root_group, + mode => '0644', + content => $manage_content, + source => $source, + require => [ + Exec["mkdir ${::apache::mod_dir}"], + ], + before => File[$::apache::mod_dir], + notify => Class['apache::service'], + } +}