Skip to content

Commit

Permalink
Merge pull request #189 from wyardley/pull136
Browse files Browse the repository at this point in the history
Update to support Apache 2.4 - rework of #136
  • Loading branch information
bastelfreak authored Sep 24, 2017
2 parents ef7ee96 + 5d34045 commit f5f3c11
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
20 changes: 11 additions & 9 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,28 @@
#
class puppetboard::params {

# puppetlabs/apache names the apache service
# resource 'httpd', nevermind the actual os
$apache_service = 'httpd'

case $::osfamily {
case $facts['os']['family'] {
'Debian': {
if $::operatingsystem == ubuntu {
$apache_confd = '/etc/apache2/conf-enabled'
if ($facts['os']['name'] == 'ubuntu') {
if (versioncmp($facts['os']['release']['full'],'14.04')) {
$apache_confd = '/etc/apache2/conf.d'
} else {
$apache_confd = '/etc/apache2/conf-enabled'
}
} else {
$apache_confd = '/etc/apache2/conf.d'
$apache_confd = '/etc/apache2/conf.d'
}
$apache_service = 'apache2'
}

'RedHat': {
$apache_confd = '/etc/httpd/conf.d'
$apache_service = 'httpd'
File {
seltype => 'httpd_sys_content_t',
}
}
default: { fail("The ${::osfamily} operating system is not supported with the puppetboard module") }
default: { fail("The ${facts['os']['family']} operating system is not supported with the puppetboard module") }
}

$manage_selinux = $::selinux ? {
Expand Down
9 changes: 7 additions & 2 deletions templates/apache/conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ WSGIScriptAlias <%= @wsgi_alias -%> <%= @docroot -%>/wsgi.py
<Directory <%= @docroot -%>>
WSGIProcessGroup puppetboard
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
## Puppet data <%= @ldap_bind_dn -%>
<% if @enable_ldap_auth != false %>
Expand Down
8 changes: 4 additions & 4 deletions templates/apache/ldap.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
Allow from All

AuthBasicProvider ldap
<% if @ldap_bind_dn != false %>
<% if @ldap_bind_dn != false %>
AuthLDAPBindDN <%= @ldap_bind_dn -%>
<% end %>
<% if @ldap_bind_password != false %>
<% if @ldap_bind_password != false %>
AuthLDAPBindPassword <%= @ldap_bind_password -%>
<% end %>
<% if @ldap_url != false %>
<% if @ldap_url != false %>
AuthLDAPURL <%= @ldap_url -%>
<% end %>
<% if @ldap_bind_authoritative != false %>
<% if @ldap_bind_authoritative != false %>
AuthLDAPBindAuthoritative <%= @ldap_bind_authoritative -%>
<% end %>
Require valid-user
Expand Down

0 comments on commit f5f3c11

Please sign in to comment.