Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On/off switch and config hash parameter for apache::mod::wsgi #389

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ The following parameters are available in the `puppetboard::apache::conf` class:
* [`ldap_require_group`](#-puppetboard--apache--conf--ldap_require_group)
* [`ldap_require_group_dn`](#-puppetboard--apache--conf--ldap_require_group_dn)
* [`virtualenv_dir`](#-puppetboard--apache--conf--virtualenv_dir)
* [`manage_mod_wsgi`](#-puppetboard--apache--conf--manage_mod_wsgi)
* [`custom_mod_wsgi_parameters`](#-puppetboard--apache--conf--custom_mod_wsgi_parameters)

##### <a name="-puppetboard--apache--conf--wsgi_alias"></a>`wsgi_alias`

Expand Down Expand Up @@ -560,6 +562,22 @@ Set location where virtualenv will be installed

Default value: `$puppetboard::virtualenv_dir`

##### <a name="-puppetboard--apache--conf--manage_mod_wsgi"></a>`manage_mod_wsgi`

Data type: `Boolean`

A parameter to switch off the use of `apache::mod::wsgi`

Default value: `true`

##### <a name="-puppetboard--apache--conf--custom_mod_wsgi_parameters"></a>`custom_mod_wsgi_parameters`

Data type: `Hash`

A hash passed to `apache::mod::wsgi`

Default value: `{}`

### <a name="puppetboard--apache--vhost"></a>`puppetboard::apache::vhost`

Sets up an apache::vhost to run PuppetBoard, and writes an appropriate wsgi.py from template
Expand Down Expand Up @@ -590,6 +608,8 @@ The following parameters are available in the `puppetboard::apache::vhost` class
* [`ldap_require_group_dn`](#-puppetboard--apache--vhost--ldap_require_group_dn)
* [`virtualenv_dir`](#-puppetboard--apache--vhost--virtualenv_dir)
* [`custom_apache_parameters`](#-puppetboard--apache--vhost--custom_apache_parameters)
* [`manage_mod_wsgi`](#-puppetboard--apache--vhost--manage_mod_wsgi)
* [`custom_mod_wsgi_parameters`](#-puppetboard--apache--vhost--custom_mod_wsgi_parameters)

##### <a name="-puppetboard--apache--vhost--vhost_name"></a>`vhost_name`

Expand Down Expand Up @@ -765,6 +785,22 @@ A hash passed to the `apache::vhost` for custom settings

Default value: `{}`

##### <a name="-puppetboard--apache--vhost--manage_mod_wsgi"></a>`manage_mod_wsgi`

Data type: `Boolean`

A parameter to switch off the use of `apache::mod::wsgi`

Default value: `true`

##### <a name="-puppetboard--apache--vhost--custom_mod_wsgi_parameters"></a>`custom_mod_wsgi_parameters`

Data type: `Hash`

A hash passed to `apache::mod::wsgi`

Default value: `{}`

## Data types

### <a name="Puppetboard--Syslogpriority"></a>`Puppetboard::Syslogpriority`
Expand Down
24 changes: 15 additions & 9 deletions manifests/apache/conf.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# @param ldap_require_group LDAP group to require on login
# @param ldap_require_group_dn LDAP group DN for LDAP group
# @param virtualenv_dir Set location where virtualenv will be installed
# @param manage_mod_wsgi A parameter to switch off the use of `apache::mod::wsgi`
# @param custom_mod_wsgi_parameters A hash passed to `apache::mod::wsgi`
#
# @note Make sure you have purge_configs set to false in your apache class!
# @note This runs the WSGI application with a WSGIProcessGroup of $user and a WSGIApplicationGroup of %{GLOBAL}.
Expand All @@ -33,16 +35,20 @@
Boolean $ldap_require_group = $puppetboard::ldap_require_group,
Optional[String[1]] $ldap_require_group_dn = undef,
Stdlib::Absolutepath $virtualenv_dir = $puppetboard::virtualenv_dir,
Boolean $manage_mod_wsgi = true,
Hash $custom_mod_wsgi_parameters = {},
) {
$wsgi = $facts['os']['family'] ? {
'Debian' => {
package_name => 'libapache2-mod-wsgi-py3',
mod_path => '/usr/lib/apache2/modules/mod_wsgi.so',
},
default => {},
}
class { 'apache::mod::wsgi':
* => $wsgi,
if $manage_mod_wsgi {
$wsgi = $facts['os']['family'] ? {
'Debian' => {
package_name => 'libapache2-mod-wsgi-py3',
mod_path => '/usr/lib/apache2/modules/mod_wsgi.so',
},
default => $custom_mod_wsgi_parameters,
}
class { 'apache::mod::wsgi':
* => $wsgi,
}
}

$docroot = "${basedir}/puppetboard"
Expand Down
24 changes: 15 additions & 9 deletions manifests/apache/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
# @param ldap_require_group_dn LDAP group DN for LDAP group
# @param virtualenv_dir Set location where virtualenv will be installed
# @param custom_apache_parameters A hash passed to the `apache::vhost` for custom settings
# @param manage_mod_wsgi A parameter to switch off the use of `apache::mod::wsgi`
# @param custom_mod_wsgi_parameters A hash passed to `apache::mod::wsgi`
class puppetboard::apache::vhost (
String[1] $vhost_name,
Stdlib::Unixpath $wsgi_alias = '/',
Expand All @@ -45,16 +47,20 @@
Optional[String[1]] $ldap_require_group_dn = undef,
Stdlib::Absolutepath $virtualenv_dir = $puppetboard::virtualenv_dir,
Hash $custom_apache_parameters = {},
Boolean $manage_mod_wsgi = true,
Hash $custom_mod_wsgi_parameters = {},
) {
$wsgi = $facts['os']['family'] ? {
'Debian' => {
package_name => 'libapache2-mod-wsgi-py3',
mod_path => '/usr/lib/apache2/modules/mod_wsgi.so',
},
default => {},
}
class { 'apache::mod::wsgi':
* => $wsgi,
if $manage_mod_wsgi {
$wsgi = $facts['os']['family'] ? {
'Debian' => {
package_name => 'libapache2-mod-wsgi-py3',
mod_path => '/usr/lib/apache2/modules/mod_wsgi.so',
},
default => $custom_mod_wsgi_parameters,
}
class { 'apache::mod::wsgi':
* => $wsgi,
}
}

$docroot = "${basedir}/puppetboard"
Expand Down