summaryrefslogtreecommitdiff
path: root/puppet/modules/site_apache/templates
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2015-12-12 23:55:00 +0100
committervarac <varacanero@zeromail.org>2015-12-12 23:55:00 +0100
commit26ece7a240fe842e5645a47bac86699c5d2bd34c (patch)
tree246b84d5a806722c4e1c9984d2617223a073b0aa /puppet/modules/site_apache/templates
parent1f9da0490a3d55831e2b834ab5801c629123d226 (diff)
[bug] Use guess_apache_version in apache templates
The apache_version() fact only works if apache is already installed. So we use the guess_apache_version() function from the apache module to determine which apache version is to be installed. - Resolves: #7681
Diffstat (limited to 'puppet/modules/site_apache/templates')
-rw-r--r--puppet/modules/site_apache/templates/vhosts.d/api.conf.erb2
-rw-r--r--puppet/modules/site_apache/templates/vhosts.d/common.conf.erb2
-rw-r--r--puppet/modules/site_apache/templates/vhosts.d/hidden_service.conf.erb12
3 files changed, 14 insertions, 2 deletions
diff --git a/puppet/modules/site_apache/templates/vhosts.d/api.conf.erb b/puppet/modules/site_apache/templates/vhosts.d/api.conf.erb
index 9efc6b41..d566437a 100644
--- a/puppet/modules/site_apache/templates/vhosts.d/api.conf.erb
+++ b/puppet/modules/site_apache/templates/vhosts.d/api.conf.erb
@@ -27,7 +27,7 @@ Listen 0.0.0.0:<%= @api_port %>
</IfModule>
DocumentRoot /srv/leap/webapp/public
- <% if Gem::Version.new(@apache_version) > Gem::Version.new('2.3') %>
+ <% if scope.function_guess_apache_version([]) == '2.4' %>
<Directory /srv/leap/webapp/public>
AllowOverride None
Require all granted
diff --git a/puppet/modules/site_apache/templates/vhosts.d/common.conf.erb b/puppet/modules/site_apache/templates/vhosts.d/common.conf.erb
index cbb08c30..b24d1353 100644
--- a/puppet/modules/site_apache/templates/vhosts.d/common.conf.erb
+++ b/puppet/modules/site_apache/templates/vhosts.d/common.conf.erb
@@ -32,7 +32,7 @@
<% if (defined? @services) and (@services.include? 'webapp') -%>
DocumentRoot /srv/leap/webapp/public
- <% if Gem::Version.new(@apache_version) > Gem::Version.new('2.3') %>
+ <% if scope.function_guess_apache_version([]) == '2.4' %>
<Directory /srv/leap/webapp/public>
AllowOverride None
Require all granted
diff --git a/puppet/modules/site_apache/templates/vhosts.d/hidden_service.conf.erb b/puppet/modules/site_apache/templates/vhosts.d/hidden_service.conf.erb
index 2c8d5eb5..653664ec 100644
--- a/puppet/modules/site_apache/templates/vhosts.d/hidden_service.conf.erb
+++ b/puppet/modules/site_apache/templates/vhosts.d/hidden_service.conf.erb
@@ -8,6 +8,12 @@
<% if (defined? @services) and (@services.include? 'webapp') -%>
DocumentRoot /srv/leap/webapp/public
+ <% if scope.function_guess_apache_version([]) == '2.4' %>
+ <Directory /srv/leap/webapp/public>
+ AllowOverride None
+ Require all granted
+ </Directory>
+ <% end %>
RewriteEngine On
# Check for maintenance file and redirect all requests
@@ -33,6 +39,12 @@
<% if (defined? @services) and (@services.include? 'static') -%>
DocumentRoot "/srv/static/root/public"
+ <% if scope.function_guess_apache_version([]) == '2.4' %>
+ <Directory /srv/static/root/public>
+ AllowOverride None
+ Require all granted
+ </Directory>
+ <% end %>
AccessFileName .htaccess
Alias /provider.json /srv/leap/provider.json