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

Update to support Apache 2.4 - rework of #136 #189

Merged
merged 2 commits into from
Sep 24, 2017
Merged
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
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