From 0d29abc5a90e2a309246e221bf63a4226595ed5e Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sat, 8 Sep 2018 18:03:28 +0200 Subject: [PATCH] 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 --- manifests/panko.pp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/manifests/panko.pp b/manifests/panko.pp index 989a72b79..2743a4eef 100644 --- a/manifests/panko.pp +++ b/manifests/panko.pp @@ -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,