diff --git a/manifests/backend/iscsi.pp b/manifests/backend/iscsi.pp index cc6cb2e5..86da186c 100644 --- a/manifests/backend/iscsi.pp +++ b/manifests/backend/iscsi.pp @@ -49,6 +49,12 @@ } 'lioadm': { + service { 'target': + ensure => running, + enable => true, + require => Package['targetcli'], + } + package { 'targetcli': ensure => present, name => $::cinder::params::lio_package_name, diff --git a/spec/classes/cinder_volume_iscsi_spec.rb b/spec/classes/cinder_volume_iscsi_spec.rb index 0e7a6814..13dc72a7 100644 --- a/spec/classes/cinder_volume_iscsi_spec.rb +++ b/spec/classes/cinder_volume_iscsi_spec.rb @@ -60,6 +60,11 @@ end it { should contain_package('targetcli').with_ensure('present')} + it { should contain_service('target').with( + :ensure => 'running', + :enable => 'true', + :require => 'Package[targetcli]' + ) } end