From f0e5a407edc917fab2c23ac27438e96947933584 Mon Sep 17 00:00:00 2001 From: Dmitry Bilunov Date: Mon, 14 Dec 2015 11:57:06 +0300 Subject: [PATCH] Disable apache's purge_configs option Successive calls to "apache" fuel task results in a non-working Horizon and Keystone due to purge_configs option set to true which wipes the contents of several directories inside /etc/apache2/ Fuel runs puppet independently for each "module" so it does not seem possible to utilize puppet's relationship metaparameters and other ordering manipulation tools to make sure that all config generators get reexecuted at this point. It seems reasonable just to disable `purge_configs' option since /etc/apache2/ directory structure already implements a framework for enabling/disabling entities such as virtual hosts, configuration snippets and modules. Manifests change the default distro's MPM configuration, so while the whole directory is not purge we still need to purge vanilla *mpm* files. Change-Id: I974ef1423187d908684fa213122e8ba314cac917 Closes-Bug: 1522857 --- deployment/puppet/osnailyfacter/manifests/apache_mpm.pp | 7 +++++++ deployment/puppet/osnailyfacter/modular/apache/apache.pp | 2 +- tests/noop/spec/hosts/apache/apache_spec.rb | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/deployment/puppet/osnailyfacter/manifests/apache_mpm.pp b/deployment/puppet/osnailyfacter/manifests/apache_mpm.pp index d6ee486738..18f9a575eb 100644 --- a/deployment/puppet/osnailyfacter/manifests/apache_mpm.pp +++ b/deployment/puppet/osnailyfacter/manifests/apache_mpm.pp @@ -27,6 +27,13 @@ class osnailyfacter::apache_mpm { $mpm_module = 'worker' } + tidy { "remove-distro-mpm-modules": + path => $::apache::params::mod_enable_dir, + recurse => true, + matches => [ '*mpm*' ], + rmdirs => false, + } + class { "::apache::mod::$mpm_module": startservers => $startservers, maxclients => $maxclients, diff --git a/deployment/puppet/osnailyfacter/modular/apache/apache.pp b/deployment/puppet/osnailyfacter/modular/apache/apache.pp index cc69eaf1ba..fe35a54e9e 100644 --- a/deployment/puppet/osnailyfacter/modular/apache/apache.pp +++ b/deployment/puppet/osnailyfacter/modular/apache/apache.pp @@ -6,7 +6,7 @@ sysctl::value { 'net.ipv4.tcp_max_syn_backlog': value => '8192' } # Listen directives with host required for ip_based vhosts class { 'osnailyfacter::apache': - purge_configs => true, + purge_configs => false, listen_ports => hiera_array('apache_ports', ['0.0.0.0:80']), } diff --git a/tests/noop/spec/hosts/apache/apache_spec.rb b/tests/noop/spec/hosts/apache/apache_spec.rb index 1559bb6500..4deb2b017d 100644 --- a/tests/noop/spec/hosts/apache/apache_spec.rb +++ b/tests/noop/spec/hosts/apache/apache_spec.rb @@ -43,6 +43,11 @@ describe manifest do :mode => '0755').with_content(/^sleep \d+/) end + it 'should not purge config files' do + should contain_class('apache').with( + 'purge_configs' => 'false', + ) + end end test_ubuntu_and_centos manifest end