From 345a8f9589b414c519c2ecbb818024e5371cfa60 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Thu, 27 Jun 2013 19:37:04 +0300 Subject: [PATCH] apache: Allow disabling mod_wsgi's embedded mode --- apache/manifests/init.pp | 48 ++++++++++++++++++- .../wsgi.conf => templates/wsgi.conf.erb} | 3 ++ 2 files changed, 49 insertions(+), 2 deletions(-) rename apache/{files/wsgi.conf => templates/wsgi.conf.erb} (70%) diff --git a/apache/manifests/init.pp b/apache/manifests/init.pp index 2c4150f..0655a1b 100644 --- a/apache/manifests/init.pp +++ b/apache/manifests/init.pp @@ -449,6 +449,13 @@ class apache::mod::include { # Install mod_fcgid. # +# === Parameters +# +# $http: +# Enable for http. Defaults to true. +# $https: +# Enable for https. Defaults to true. +# class apache::mod::fcgid($http=true, $https=true) { package { "mod_fcgid": @@ -539,6 +546,13 @@ class apache::mod::ldap { # Install mod_passenger. # +# === Parameters +# +# $http: +# Enable for http. Defaults to true. +# $https: +# Enable for https. Defaults to true. +# class apache::mod::passenger($http=true, $https=true) { package { "mod_passenger": @@ -581,6 +595,13 @@ class apache::mod::passenger($http=true, $https=true) { # Install mod_perl. # +# === Parameters +# +# $http: +# Enable for http. Defaults to true. +# $https: +# Enable for https. Defaults to true. +# class apache::mod::perl($http=true, $https=true) { package { "mod_perl": @@ -616,6 +637,13 @@ class apache::mod::perl($http=true, $https=true) { # Install PHP. # +# === Parameters +# +# $http: +# Enable for http. Defaults to true. +# $https: +# Enable for https. Defaults to true. +# class apache::mod::php($http=true, $https=true) { package { "php": @@ -708,6 +736,13 @@ class apache::mod::proxy_balancer { # Install mod_python. # +# === Parameters +# +# $http: +# Enable for http. Defaults to true. +# $https: +# Enable for https. Defaults to true. +# class apache::mod::python($http=true, $https=true) { package { "mod_python": @@ -760,7 +795,16 @@ class apache::mod::rewrite { # Install mod_wsgi. # -class apache::mod::wsgi($http=true, $https=true) { +# === Parameters +# +# $http: +# Enable for http. Defaults to true. +# $https: +# Enable for https. Defaults to true. +# $embedded: +# Allow running scripts in embedded mode. Defaults to true. +# +class apache::mod::wsgi($http=true, $https=true, $embedded=true) { package { "mod_wsgi": name => $::operatingsystem ? { @@ -789,7 +833,7 @@ class apache::mod::wsgi($http=true, $https=true) { apache::configfile { "wsgi.conf": http => $http, https => $https, - source => "puppet:///modules/apache/wsgi.conf", + content => template("apache/wsgi.conf.erb"), require => Package["mod_wsgi"], } } diff --git a/apache/files/wsgi.conf b/apache/templates/wsgi.conf.erb similarity index 70% rename from apache/files/wsgi.conf rename to apache/templates/wsgi.conf.erb index d4739e2..4a3e9ad 100644 --- a/apache/files/wsgi.conf +++ b/apache/templates/wsgi.conf.erb @@ -1,5 +1,8 @@ LoadModule wsgi_module modules/mod_wsgi.so WSGISocketPrefix /var/run/mod_wsgi/wsgi +<% if @embedded == false -%> +WSGIRestrictEmbedded On +<% end -%> SetEnv WSGI_PROCESS_GROUP WSGIProcessGroup %{ENV:WSGI_PROCESS_GROUP}