Fix Ubuntu idempotency and pkg upgrades

The Ubuntu packages for panko-api now defaults
to installing with Apache and WSGI so it drops
the vhost files in the directory which the apache
module then removes.

We force them as empty and by that we keep idempotency
but we also dont break package upgrades for panko-api
because the dh-apache helper for deb packging fails if
these files are removed.

This is the same as we've done for keystone, sahara etc.

Change-Id: I4466d14b825a2392594a1b86b08aeed5793c77b8
This commit is contained in:
Tobias Urdin 2018-09-08 18:03:28 +02:00
parent ddc4986c60
commit 0d29abc5a9
1 changed files with 15 additions and 0 deletions

View File

@ -39,6 +39,21 @@ class openstack_integration::panko {
enabled => true,
service_name => 'httpd',
}
# NOTE(tobias-urdin): The panko-api package in Ubuntu installs the apache vhosts which we
# not need but we keep them as empty to not break package upgrades.
if ($::operatingsystem == 'Ubuntu') and (versioncmp($::operatingsystemmajrelease, '18') >= 0) {
ensure_resource('file', '/etc/apache2/sites-available/panko-api.conf', {
'ensure' => 'present',
'content' => '',
})
ensure_resource('file', '/etc/apache2/sites-enabled/panko-api.conf', {
'ensure' => 'present',
'content' => '',
})
Package['panko-api'] -> File['/etc/apache2/sites-available/panko-api.conf']
-> File['/etc/apache2/sites-enabled/panko-api.conf'] ~> Anchor['panko::install::end']
}
include ::apache
class { '::panko::wsgi::apache':
bind_host => $::openstack_integration::config::ip_for_url,