From 9d3af781e74a6eb537ad53ca504b6a5994af6b1d Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Tue, 22 Oct 2019 13:50:03 +0200 Subject: [PATCH] Only configure libvirt-guests if enabled If NovaResumeGuestsStateOnHostBoot is not true, there is no reason to configure libvirt-guests. Also a customized libvirt-guests systemd unit file is added via [1] which already has the dependencies configured. Therefore there is no need to manage them via puppet again. Related-Bug: #1849264 Depends-On: https://review.opendev.org/690016 [1] https://github.com/openstack/tripleo-heat-templates/blob/master/deployment/nova/nova-compute-container-puppet.yaml#L777 Change-Id: Ic127937ad83eebb47e34c5f36c826f8dcf1048a9 --- .../base/nova/compute/libvirt_guests.pp | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/manifests/profile/base/nova/compute/libvirt_guests.pp b/manifests/profile/base/nova/compute/libvirt_guests.pp index cde2fdda4..0fefe23fc 100644 --- a/manifests/profile/base/nova/compute/libvirt_guests.pp +++ b/manifests/profile/base/nova/compute/libvirt_guests.pp @@ -31,26 +31,11 @@ class tripleo::profile::base::nova::compute::libvirt_guests ( $step = Integer(hiera('step')), $enabled = undef, ) { - if $step >= 4 { + # only configure libvirt-guests if enabled + if $step >= 4 and $enabled { class { '::nova::compute::libvirt_guests': - enabled => $enabled, + enabled => $enabled, } include ::nova::compute::libvirt_guests - - #set dep to docker to make sure we shutdown instances before libvirt - #container stops - if str2bool(hiera('docker_enabled', false)) { - include ::systemd::systemctl::daemon_reload - - Package<| name == 'docker' |> - -> file { '/etc/systemd/system/virt-guest-shutdown.target.wants': - ensure => directory, - } - -> systemd::unit_file { 'paunch-container-shutdown.service': - path => '/etc/systemd/system/virt-guest-shutdown.target.wants', - target => '/usr/lib/systemd/system/paunch-container-shutdown.service', - before => Class['::nova::compute::libvirt_guests'], - } - } } }