From 7f5385e90ec098bcbdfcb2ac24047547e714e2bc Mon Sep 17 00:00:00 2001 From: Yanis Guenane Date: Tue, 4 Mar 2014 15:16:13 -0500 Subject: [PATCH] Ensure dbus is running before starting libvirt Customer backport Related to #330 --- manifests/compute/hypervisor.pp | 8 +++++++ spec/classes/cloud_compute_hypervisor_spec.rb | 21 +++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/manifests/compute/hypervisor.pp b/manifests/compute/hypervisor.pp index 12329acc..abac274a 100644 --- a/manifests/compute/hypervisor.pp +++ b/manifests/compute/hypervisor.pp @@ -102,6 +102,14 @@ Host * } + if $::operatingsystem == 'Ubuntu' { + service { 'dbus': + ensure => running, + enable => true, + before => Class['nova::compute::libvirt'], + } + } + Service<| title == 'dbus' |> { enable => true } Service<| title == 'libvirt-bin' |> { enable => true } diff --git a/spec/classes/cloud_compute_hypervisor_spec.rb b/spec/classes/cloud_compute_hypervisor_spec.rb index 4fd52157..57850bba 100644 --- a/spec/classes/cloud_compute_hypervisor_spec.rb +++ b/spec/classes/cloud_compute_hypervisor_spec.rb @@ -248,6 +248,22 @@ describe 'cloud::compute::hypervisor' do should contain_nova_config('DEFAULT/live_migration_flag').with('value' => 'VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST') end + context 'with dbus on Ubuntu' do + let :facts do + { :osfamily => 'Debian', + :operatingsystem => 'Ubuntu', + :concat_basedir => '/var/lib/puppet/concat' + } + end + + it 'ensure dbus is running and started at boot' do + should contain_service('dbus').with( + :ensure => 'running', + :enable => 'true' + ) + end + end + context 'without RBD backend' do before :each do params.merge!( :has_ceph => false ) @@ -269,8 +285,9 @@ describe 'cloud::compute::hypervisor' do context 'on Debian platforms' do let :facts do - { :osfamily => 'Debian', - :concat_basedir => '/var/lib/puppet/concat' + { :osfamily => 'Debian', + :operatingsystem => 'Debian', + :concat_basedir => '/var/lib/puppet/concat' } end