Files
puppet-nova/manifests/compute/libvirt.pp
Adam Compton 352e2caeed Manage the messagebus service on non-RHEL RHEL-like platforms
Previously, the test for enabling the "messagebus" service checked
for "$operatingsystem == RedHat", which only matches on RHEL;
$operatingsystem is "CentOS" on CentOS machines. I think we want
"$osfamily" here, which is "RedHat" on CentOS machines.

I also added a test for "$operatingsystem != Fedora" to preserve
the existing behavior on those machines, which as far as I can
tell do not require this service.

Change-Id: I020591006df87a9766cefbe36740940915924180
2013-06-11 16:39:11 -07:00

56 lines
1.4 KiB
Puppet

#
class nova::compute::libvirt (
$libvirt_type = 'kvm',
$vncserver_listen = '127.0.0.1',
$migration_support = false
) {
include nova::params
Service['libvirt'] -> Service['nova-compute']
if($::osfamily == 'Debian') {
package { "nova-compute-${libvirt_type}":
ensure => present,
before => Package['nova-compute'],
}
}
if($::osfamily == 'RedHat' and $::operatingsystem != 'Fedora') {
service { 'messagebus':
ensure => running,
enable => true,
provider => $::nova::params::special_service_provider,
}
Package['libvirt'] -> Service['messagebus'] -> Service['libvirt']
}
if $migration_support {
if $vncserver_listen != '0.0.0.0' {
fail("For migration support to work, you MUST set vncserver_listen to '0.0.0.0'")
} else {
class { 'nova::migration::libvirt': }
}
}
package { 'libvirt':
name => $::nova::params::libvirt_package_name,
ensure => present,
}
service { 'libvirt' :
name => $::nova::params::libvirt_service_name,
ensure => running,
provider => $::nova::params::special_service_provider,
require => Package['libvirt'],
}
nova_config {
'DEFAULT/compute_driver': value => 'libvirt.LibvirtDriver';
'DEFAULT/libvirt_type': value => $libvirt_type;
'DEFAULT/connection_type': value => 'libvirt';
'DEFAULT/vncserver_listen': value => $vncserver_listen;
}
}