Only set special_service_provider on RHEL.

Updates the params.pp so that special_service_provider is set
to 'init' on RHEL only. This gets used to startup libvirtd.

This fixes issues using the Nova compute/libvirt module on
Fedora.

Change-Id: I81f6a50a10f8e16e5d54b93724258a977c35d61f
This commit is contained in:
Dan Prince
2013-04-05 10:48:35 -04:00
parent b5ca4d11f2
commit d562af9e93
2 changed files with 44 additions and 3 deletions

View File

@@ -33,10 +33,17 @@ class nova::params {
$tgt_service_name = 'tgtd'
$vncproxy_service_name = 'openstack-nova-novncproxy'
$volume_service_name = 'openstack-nova-volume'
$special_service_provider = 'init'
# redhat specific config defaults
$root_helper = 'sudo nova-rootwrap'
$lock_path = '/var/lib/nova/tmp'
case $::operatingsystem {
'RedHat': {
$special_service_provider = 'init'
}
default: {
$special_service_provider = undef
}
}
}
'Debian': {
# package names

View File

@@ -76,7 +76,7 @@ describe 'nova::compute::libvirt' do
describe 'on rhel platforms' do
let :facts do
{ :osfamily => 'RedHat' }
{ :operatingsystem => 'RedHat', :osfamily => 'RedHat' }
end
describe 'with default parameters' do
@@ -98,7 +98,8 @@ describe 'nova::compute::libvirt' do
it { should contain_service('messagebus').with(
:ensure => 'running',
:enable => true,
:before => 'Service[libvirt]'
:before => 'Service[libvirt]',
:provider => 'init'
) }
it { should contain_nova_config('compute_driver').with_value('libvirt.LibvirtDriver')}
@@ -140,5 +141,38 @@ describe 'nova::compute::libvirt' do
raise_error(Puppet::Error, /For migration support to work, you MUST set vncserver_listen to '0.0.0.0'/) }
end
end
describe 'with default parameters on Fedora' do
let :facts do
{ :operatingsystem => 'Fedora', :osfamily => 'RedHat' }
end
it { should include_class('nova::params')}
it { should contain_package('libvirt').with(
:name => 'libvirt',
:ensure => 'present'
) }
it { should contain_service('libvirt').with(
:name => 'libvirtd',
:ensure => 'running',
:provider => nil,
:require => 'Package[libvirt]',
:before => 'Service[nova-compute]'
)}
it { should contain_service('messagebus').with(
:ensure => 'running',
:enable => true,
:before => 'Service[libvirt]',
:provider => nil
) }
it { should contain_nova_config('compute_driver').with_value('libvirt.LibvirtDriver')}
it { should contain_nova_config('libvirt_type').with_value('kvm')}
it { should contain_nova_config('connection_type').with_value('libvirt')}
it { should contain_nova_config('vncserver_listen').with_value('127.0.0.1')}
end
end
end