diff --git a/manifests/mod_wsgi.pp b/manifests/mod_wsgi.pp new file mode 100644 index 0000000000000000000000000000000000000000..6172ff93da0b3d775832c917883211a09d530005 --- /dev/null +++ b/manifests/mod_wsgi.pp @@ -0,0 +1,47 @@ +# Copyright (C) 2014 Kent Engström, Thomas Bellman. +# Licensed under the GNU LGPL v3+; see the README file for more information. + + +/* + * Install the Apache mod_wsgi module for running Python WSGI applications. + */ +class apache::mod_wsgi +{ + include apache + + $default_options = { + # Default WSGISocketPrefix value broken on at least RHEL/Fedora + 'WSGISocketPrefix' => 'run/wsgi', + } + package { + 'mod_wsgi': + ensure => installed, + # We want conf.d to be cleaned up from whatever mod_wsgi puts there + before => File[$apache::configdir]; + } + apache::module::globalconfig { + 'wsgi': + loadmodule => 'wsgi_module modules/mod_wsgi.so', + directives => [], + defaultoptions => $default_options, + options => { }, + require => Package['mod_wsgi']; + } +} + + +class apache::mod_wsgi::absent + inherits apache::mod_wsgi +{ + # Remove the configuration referencing the module before the actual + # module, in case the machine reboots in the middle. + Package['mod_wsgi'] { + ensure => absent, + before => [], + } + Apache::Module::Globalconfig['wsgi'] { + ensure => absent, + require => [], + before => Package['mod_wsgi'], + } +}