Include /etc/cinder/volumes/ in tgt targets.conf

This config isn't included in the RHEL packages
This commit is contained in:
Derek Higgins 2012-11-08 09:40:12 -05:00
parent bd9853a2bf
commit c4f4a30922
2 changed files with 28 additions and 0 deletions

View File

@ -19,6 +19,17 @@ class cinder::volume::iscsi (
name => $::cinder::params::tgt_package_name,
ensure => present,
}
if($::osfamily == 'RedHat') {
file_line { 'cinder include':
path => '/etc/tgt/targets.conf',
line => "include /etc/cinder/volumes/*",
match => '#?include /',
require => Package['tgt'],
notify => Service['tgtd'],
}
}
service { 'tgtd':
name => $::cinder::params::tgt_service_name,
ensure => running,

View File

@ -28,4 +28,21 @@ describe 'cinder::volume::iscsi' do
end
describe 'with RedHat' do
let :params do
req_params
end
let :facts do
{:osfamily => 'RedHat'}
end
it { should contain_file_line('cinder include').with(
:line => 'include /etc/cinder/volumes/*',
:path => '/etc/tgt/targets.conf'
) }
end
end