Manage package created apache config file

The Ubuntu Cloud Archive barbican-api package deposits a config file in
/etc/apache2/conf-enable, and then enables it. This configuration has a
duplicate definition for the WSGI process that is used by puppet. This
will cause apache to not start, or reload. The new behavior is to modify
the package deposited file of the new file names, as a comment like done
with the puppet-horizon package. RedHat family was added for parity.

Change-Id: I5c857a342000d04fe87c314c12bded78975d0c97
Closes-Bug: 1633850
This commit is contained in:
Matthew J Black 2016-10-16 08:52:02 -04:00
parent 0817c6c2d9
commit 25f2899ef8
4 changed files with 23 additions and 0 deletions

View File

@ -13,6 +13,7 @@ class barbican::params {
$barbican_wsgi_script_path = '/var/www/cgi-bin/barbican'
$barbican_wsgi_script_source = '/usr/lib/python2.7/site-packages/barbican/api/app.wsgi'
$dogtag_client_package = 'pki-base'
$httpd_config_file = '/etc/httpd/conf.d/barbican-api.conf'
}
'Debian': {
$api_package_name = 'barbican-api'
@ -22,6 +23,7 @@ class barbican::params {
$barbican_wsgi_script_path = '/usr/lib/cgi-bin/barbican'
$barbican_wsgi_script_source = '/usr/lib/python2.7/dist-packages/barbican/api/app.wsgi'
$dogtag_client_package = 'pki-base'
$httpd_config_file = '/etc/apache2/conf-available/barbican-api.conf'
}
default: {
fail("Unsupported osfamily: ${::osfamily} operating system")

View File

@ -203,6 +203,20 @@ class barbican::wsgi::apache (
$wsgi_script_aliases_main = hash([$public_path_real,"${::barbican::params::barbican_wsgi_script_path}/main"])
$wsgi_script_aliases_main_real = $wsgi_script_aliases_main
file { $::barbican::params::httpd_config_file:
ensure => present,
content => "#
# This file has been cleaned by Puppet.
#
# OpenStack Horizon configuration has been moved to:
# - ${priority}-barbican_wsgi_main.conf
#",
}
Package<| tag == 'barbican-api' |> -> File[$::barbican::params::httpd_config_file]
File[$::barbican::params::httpd_config_file] ~> Service['httpd']
::apache::vhost { 'barbican_wsgi_main':
ensure => 'present',
servername => $servername,

View File

@ -0,0 +1,4 @@
---
issues:
- Ubuntu Cloud Archive barbican-api package deposits a config, in a different directory, that conflicts with the puppet created config.
The behavior now is to update the config deposited by the package to have only a comment to inform of the correct config file.

View File

@ -70,6 +70,7 @@ describe 'barbican::wsgi::apache' do
'access_log_format' => false,
)}
it { is_expected.to contain_concat("#{platform_parameters[:httpd_ports_file]}") }
it { is_expected.to contain_file(platform_parameters[:httpd_config_file]) }
end
describe 'when overriding default apache logging' do
@ -122,12 +123,14 @@ describe 'barbican::wsgi::apache' do
:httpd_service_name => 'apache2',
:httpd_ports_file => '/etc/apache2/ports.conf',
:wsgi_script_path => '/usr/lib/cgi-bin/barbican',
:httpd_config_file => '/etc/apache2/conf-available/barbican-api.conf',
}
when 'RedHat'
{
:httpd_service_name => 'httpd',
:httpd_ports_file => '/etc/httpd/conf/ports.conf',
:wsgi_script_path => '/var/www/cgi-bin/barbican',
:httpd_config_file => '/etc/httpd/conf.d/barbican-api.conf',
}
end
end