diff --git a/manifests/mod_perl.pp b/manifests/mod_perl.pp new file mode 100644 index 0000000000000000000000000000000000000000..6711a2261608e53ce01816d0c852a80746682b0f --- /dev/null +++ b/manifests/mod_perl.pp @@ -0,0 +1,59 @@ +import "apache" + + +/* + * Install the Apache mod_perl module. + */ +class apache::mod_perl +{ + include apache + + $default_options = { + # Enable taint checking by default. Lots of Perl modules fail with + # this, though, so users may need to disable this. + 'PerlSwitches' => '-T', + } + package { + 'mod_perl': + ensure => installed, + # We want conf.d to be cleaned up from whatever mod_perl puts there + before => File[$apache::configdir]; + } + apache::module::globalconfig { + 'perl': + loadmodule => 'perl_module modules/mod_perl.so', + directives => [], + defaultoptions => $default_options, + options => { }, + require => Package['mod_perl']; + } +} + + +/* + * As apache::mod_perl, but do not run Perl in taint mode. + */ +class apache::mod_perl::notaint + inherits apache::mod_perl +{ + Apache::Module::Globalconfig['perl'] { + defaultoptions => { }, + } +} + + +class apache::mod_perl::absent + inherits apache::mod_perl +{ + # Remove the configuration referencing the module before the actual + # module, in case the machine reboots in the middle. + Package['mod_perl'] { + ensure => absent, + before => [], + } + Apache::Module::Globalconfig['perl'] { + ensure => absent, + require => [], + before => Package['mod_perl'], + } +}