Clear out keystone package config on ubuntu

See Bug 1737697.  The ubuntu packaging provides a default keystone.conf
which we want to remove because we manage the keystone vhost
configuration via puppet. This change moves the logic we had in
puppet-openstack-integration into puppet-keystone proper.  Once the code
is removed from p-o-i, we can switch these to actual file resources
rather than using ensure_resource

Change-Id: Iea8f531a8eff4c053cff01a7f75ce43024c97c7b
This commit is contained in:
Alex Schultz 2019-04-24 15:38:21 -06:00
parent 5d32d64629
commit 3bebe58c4f
2 changed files with 34 additions and 0 deletions

View File

@ -328,4 +328,23 @@ please use custom_wsgi_process_options')
error_log_pipe => $error_log_pipe,
error_log_syslog => $error_log_syslog,
}
# Workaround to empty Keystone vhost that is provided & activated by default with running
# Canonical packaging (called 'keystone'). This will make sure upgrading the package is
# possible, see https://bugs.launchpad.net/ubuntu/+source/keystone/+bug/1737697
if ($::operatingsystem == 'Ubuntu') {
ensure_resource('file', '/etc/apache2/sites-available/keystone.conf', {
'ensure' => 'file',
'content' => '',
})
ensure_resource('file', '/etc/apache2/sites-enabled/keystone.conf', {
'ensure' => 'file',
'content' => '',
})
Package<| tag == 'keystone-package' |>
-> File<| title == '/etc/apache2/sites-available/keystone.conf' |>
-> File<| title == '/etc/apache2/sites-enabled/keystone.conf'|>
~> Anchor['keystone::install::end']
}
}

View File

@ -178,6 +178,18 @@ describe 'keystone::wsgi::apache' do
end
end
shared_examples 'keystone::wsgi::apache on Ubuntu' do
context 'with default parameters' do
it {
is_expected.to contain_file('/etc/apache2/sites-available/keystone.conf').with(
:ensure => 'file',
:content => '')
is_expected.to contain_file('/etc/apache2/sites-enabled/keystone.conf').with(
:ensure => 'file',
:content => '')
}
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
@ -208,6 +220,9 @@ describe 'keystone::wsgi::apache' do
end
it_behaves_like 'keystone::wsgi::apache'
if facts[:operatingsystem] == 'Ubuntu'
it_behaves_like 'keystone::wsgi::apache on Ubuntu'
end
end
end
end