From 10bb4095f02b5ba5e1d20f06b01bdae415eecdb4 Mon Sep 17 00:00:00 2001 From: Danilo Ramalho Date: Mon, 16 Nov 2015 22:22:38 -0200 Subject: [PATCH] Fix httpd apply in Ubuntu Precise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alteration of the Apache configuration for apply in the Ubuntu Precise. It was changed for mod_disk_cache because mod_cache_disk not exist for the Precise and check Apache Version due the parameter "Require all Granted". Change-Id: Icc1d13fc39058f147bdbb1e6b9a810143051ece4 Co-Authored-By: MaitĂȘ Balhester --- manifests/api.pp | 10 ++++++++-- templates/openstack-health-api.vhost.erb | 12 +++++++++--- templates/openstack-health-frontend.vhost.erb | 4 +++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index 527b133..86f67b3 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -71,8 +71,14 @@ class openstack_health::api( ensure => present, } } - if ! defined(Httpd::Mod['cache_disk']) { - httpd::mod { 'cache_disk': + + if $::operatingsystem == 'Ubuntu' and $::operatingsystemrelease == '12.04' { + $cache_disk_module = 'disk_cache' + } else { + $cache_disk_module = 'cache_disk' + } + if ! defined(Httpd::Mod[$cache_disk_module]) { + httpd::mod { $cache_disk_module: ensure => present, } } diff --git a/templates/openstack-health-api.vhost.erb b/templates/openstack-health-api.vhost.erb index 3f7b260..9d6bcc6 100644 --- a/templates/openstack-health-api.vhost.erb +++ b/templates/openstack-health-api.vhost.erb @@ -20,17 +20,23 @@ WSGIPythonHome <%= scope.lookupvar("openstack_health::api::virtualenv_dir") %> Order allow,deny Allow from all - Require all granted + = 2.4> + Require all granted + - + <% if @operatingsystem == "Ubuntu" and @operatingsystemrelease == "12.04" %> + + <% else %> + + <% end %> CacheRoot "/var/cache/apache2/mod_disk_cache" CacheEnable disk "/" CacheDirLevels 5 CacheDirLength 3 CacheLock on - + DocumentRoot <%= scope.lookupvar("openstack_health::api::api_dir") %> diff --git a/templates/openstack-health-frontend.vhost.erb b/templates/openstack-health-frontend.vhost.erb index d14f8fa..37fe134 100644 --- a/templates/openstack-health-frontend.vhost.erb +++ b/templates/openstack-health-frontend.vhost.erb @@ -12,7 +12,9 @@ Listen <%= @vhost_port %> > Order allow,deny Allow from all - Require all granted + = 2.4> + Require all granted + DocumentRoot <%= @frontend_dir %>