apache: Allow enabling modules separately for http/https

Added parameters http and https (both enabled by default) for the
following classes:

 * apache::mod::fcgid
 * apache::mod::passenger
 * apache::mod::perl
 * apache::mod::php
 * apache::mod::python
 * apache::mod::wsgi
This commit is contained in:
Ossi Salmi 2013-06-16 17:33:17 +03:00
parent 36205c0548
commit ff003d864c

View file

@ -449,7 +449,7 @@ class apache::mod::include {
# Install mod_fcgid. # Install mod_fcgid.
# #
class apache::mod::fcgid { class apache::mod::fcgid($http=true, $https=true) {
package { "mod_fcgid": package { "mod_fcgid":
name => $::operatingsystem ? { name => $::operatingsystem ? {
@ -468,7 +468,7 @@ class apache::mod::fcgid {
} }
} }
"centos","redhat","fedora": { "centos","redhat","fedora": {
if defined(Class["apache::server"]) { if $http == true and defined(Class["apache::server"]) {
file { "/var/run/mod_fcgid": file { "/var/run/mod_fcgid":
ensure => directory, ensure => directory,
mode => "0755", mode => "0755",
@ -481,7 +481,7 @@ class apache::mod::fcgid {
https => false, https => false,
} }
} }
if defined(Class["apache::sslserver"]) { if $https == true and defined(Class["apache::sslserver"]) {
file { "/var/run/mod_fcgid_httpsd": file { "/var/run/mod_fcgid_httpsd":
ensure => directory, ensure => directory,
mode => "0755", mode => "0755",
@ -539,7 +539,7 @@ class apache::mod::ldap {
# Install mod_passenger. # Install mod_passenger.
# #
class apache::mod::passenger { class apache::mod::passenger($http=true, $https=true) {
package { "mod_passenger": package { "mod_passenger":
name => $::operatingsystem ? { name => $::operatingsystem ? {
@ -559,6 +559,8 @@ class apache::mod::passenger {
} }
"centos","redhat","fedora": { "centos","redhat","fedora": {
apache::configfile { "passenger.conf": apache::configfile { "passenger.conf":
http => $http,
https => $https,
require => Package["mod_passenger"], require => Package["mod_passenger"],
} }
} }
@ -579,7 +581,7 @@ class apache::mod::passenger {
# Install mod_perl. # Install mod_perl.
# #
class apache::mod::perl { class apache::mod::perl($http=true, $https=true) {
package { "mod_perl": package { "mod_perl":
name => $::operatingsystem ? { name => $::operatingsystem ? {
@ -599,6 +601,8 @@ class apache::mod::perl {
} }
"centos","redhat","fedora": { "centos","redhat","fedora": {
apache::configfile { "perl.conf": apache::configfile { "perl.conf":
http => $http,
https => $https,
require => Package["mod_perl"], require => Package["mod_perl"],
} }
} }
@ -612,7 +616,7 @@ class apache::mod::perl {
# Install PHP. # Install PHP.
# #
class apache::mod::php { class apache::mod::php($http=true, $https=true) {
package { "php": package { "php":
name => $::operatingsystem ? { name => $::operatingsystem ? {
@ -632,6 +636,8 @@ class apache::mod::php {
} }
"centos","redhat","fedora": { "centos","redhat","fedora": {
apache::configfile { "php.conf": apache::configfile { "php.conf":
http => $http,
https => $https,
require => Package["php"], require => Package["php"],
} }
} }
@ -702,7 +708,7 @@ class apache::mod::proxy_balancer {
# Install mod_python. # Install mod_python.
# #
class apache::mod::python { class apache::mod::python($http=true, $https=true) {
package { "mod_python": package { "mod_python":
name => $::operatingsystem ? { name => $::operatingsystem ? {
@ -722,6 +728,8 @@ class apache::mod::python {
} }
"centos","redhat","fedora": { "centos","redhat","fedora": {
apache::configfile { "python.conf": apache::configfile { "python.conf":
http => $http,
https => $https,
require => Package["mod_python"], require => Package["mod_python"],
} }
} }
@ -752,7 +760,7 @@ class apache::mod::rewrite {
# Install mod_wsgi. # Install mod_wsgi.
# #
class apache::mod::wsgi { class apache::mod::wsgi($http=true, $https=true) {
package { "mod_wsgi": package { "mod_wsgi":
name => $::operatingsystem ? { name => $::operatingsystem ? {
@ -779,6 +787,8 @@ class apache::mod::wsgi {
before => Apache::Configfile["wsgi.conf"], before => Apache::Configfile["wsgi.conf"],
} }
apache::configfile { "wsgi.conf": apache::configfile { "wsgi.conf":
http => $http,
https => $https,
source => "puppet:///modules/apache/wsgi.conf", source => "puppet:///modules/apache/wsgi.conf",
require => Package["mod_wsgi"], require => Package["mod_wsgi"],
} }