Files
puppet-nova/manifests/compute/libvirt.pp
Logan McNaughton 8f77b5f11c Fix some puppet lint warnings.
Puppet-lint likes the ensure's to come first.

Change-Id: I127ee497d01c7a466338a334a61b47d862d79097
2013-08-09 16:41:40 +00: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':
ensure => present,
name => $::nova::params::libvirt_package_name,
}
service { 'libvirt' :
ensure => running,
name => $::nova::params::libvirt_service_name,
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;
}
}