CentOS: Install libvirt-daemon only when needed

When libvirt service name is false then the core libvirt package is not
managed. So the libvir-daemon package should be also unmanaged.

Change-Id: I89ca6864ae476f5081fca65512caafae7642802e
This commit is contained in:
Takashi Kajinami
2024-06-03 18:37:37 +09:00
parent 7617973329
commit bdd63d3761
2 changed files with 10 additions and 9 deletions

View File

@@ -131,6 +131,15 @@ class nova::compute::libvirt::services (
} else {
$libvirt_service_ensure = 'running'
$libvirt_service_enable = true
if $facts['os']['family'] == 'RedHat' {
package { 'libvirt-daemon':
ensure => $ensure_package,
name => $::nova::params::libvirt_daemon_package_name,
tag => ['openstack', 'nova-support-package'],
}
Package['libvirt-daemon'] ~> Service<| title == 'libvirt' |>
}
}
service { 'libvirt':
@@ -166,15 +175,6 @@ class nova::compute::libvirt::services (
Service<| title == 'virtlogd' |>
-> Service<| title == 'libvirt' |>
-> Service<| title == 'nova-compute'|>
if $facts['os']['family'] == 'RedHat' {
package { 'libvirt-daemon':
ensure => $ensure_package,
name => $::nova::params::libvirt_daemon_package_name,
tag => ['openstack', 'nova-support-package'],
}
Package['libvirt-daemon'] ~> Service<| title == 'libvirt' |>
}
} else {
# NOTE(tkajinam): libvirt should be stopped before starting modular daemons
Service<| title == 'libvirt' |> -> Service<| tag == 'libvirt-modular-service' |>

View File

@@ -47,6 +47,7 @@ describe 'nova::compute::libvirt::services' do
it 'skips installing libvirt' do
is_expected.not_to contain_package('libvirt')
is_expected.not_to contain_package('libvirt-daemon')
is_expected.not_to contain_service('libvirt')
end