diff --git a/manifests/params.pp b/manifests/params.pp index 3f6aa57a4..323a74db1 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -44,6 +44,13 @@ class nova::params { 'Fedora': { $special_service_provider = undef } + 'RedHat': { + if ($::operatingsystemrelease < 7) { + $special_service_provider = 'init' + } else { + $special_service_provider = undef + } + } default: { $special_service_provider = 'init' } diff --git a/spec/classes/nova_compute_libvirt_spec.rb b/spec/classes/nova_compute_libvirt_spec.rb index 48897c8bd..8f4a6dc31 100644 --- a/spec/classes/nova_compute_libvirt_spec.rb +++ b/spec/classes/nova_compute_libvirt_spec.rb @@ -103,7 +103,8 @@ describe 'nova::compute::libvirt' do describe 'on rhel platforms' do let :facts do - { :operatingsystem => 'RedHat', :osfamily => 'RedHat' } + { :operatingsystem => 'RedHat', :osfamily => 'RedHat', + :operatingsystemrelease => 6.5 } end describe 'with default parameters' do @@ -130,6 +131,20 @@ describe 'nova::compute::libvirt' do :provider => 'init' ) } + describe 'on rhel 7' do + let :facts do + super().merge(:operatingsystemrelease => 7.0) + end + + it { should contain_service('libvirt').with( + :provider => nil + )} + + it { should contain_service('messagebus').with( + :provider => nil + )} + end + it { should contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.LibvirtDriver')} it { should contain_nova_config('libvirt/virt_type').with_value('kvm')} it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('127.0.0.1')}