Files
puppet-nova/manifests/compute/libvirt.pp
Logan McNaughton 13a20c94d4 Fixes some puppet lint warnings
This commit fixes the following warnings:
manifests/compute/libvirt.pp - WARNING: double quoted string containing no variables on line 31
manifests/init.pp - WARNING: class inheriting from params class on line 77
manifests/migration/libvirt.pp - WARNING: case statement without a default case on line 4

Change-Id: I84a1f5edfd63973fcfa963f9acfa954cf06c094b
2013-08-13 17:49:53 +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;
}
}