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
This commit is contained in:
Martin Schuppert 2019-10-22 13:50:03 +02:00
parent c97dbd1946
commit 9d3af781e7

View File

@ -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'],
}
}
}
}