rbd/pools: support RH libvirt package name

On Red Hat systems, libvirt package is not libvirt-bin.
So we need to support both Debian & RH systems to manage RBD
configuration.
This commit is contained in:
Emilien Macchi 2014-06-04 16:27:26 +02:00
parent 7debb28e8a
commit 1808449946

View File

@ -87,11 +87,17 @@ class cloud::storage::rbd::pools(
tag => 'ceph_compute_secret_file',
}
if $::osfamily == 'RedHat' {
$libvirt_package_name = 'libvirt'
} else {
$libvirt_package_name = 'libvirt-bin'
}
@@exec { 'get_or_set_virsh_secret':
command => 'virsh secret-define --file /etc/ceph/secret.xml',
unless => "virsh secret-list | tail -n +3 | cut -f1 -d' ' | grep -sq ${ceph_fsid}",
tag => 'ceph_compute_get_secret',
require => [Package['libvirt-bin'],File['/etc/ceph/secret.xml']],
require => [Package[$libvirt_package_name],File['/etc/ceph/secret.xml']],
notify => Exec['set_secret_value_virsh'],
}