Merge pull request #147 from dachary/master
add support for the 'iscsitarget' implementation of iscsi_helper
This commit is contained in:
commit
b3025d37a0
|
@ -49,8 +49,34 @@ class nova::volume::iscsi (
|
|||
nova_config { 'iscsi_helper': value => 'tgtadm' }
|
||||
}
|
||||
|
||||
'iscsitarget': {
|
||||
package { 'iscsitarget':
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
service { 'iscsitarget':
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => [Nova::Generic_service['volume'], Package['iscsitarget']],
|
||||
}
|
||||
|
||||
service { 'open-iscsi':
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => Service['iscsitarget'],
|
||||
}
|
||||
|
||||
package { 'iscsitarget-dkms':
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
file { '/etc/default/iscsitarget':
|
||||
content => "ISCSITARGET_ENABLE=true\n",
|
||||
}
|
||||
}
|
||||
|
||||
default: {
|
||||
fail("Unsupported iscsi helper: ${iscsi_helper}. The supported iscsi helper is tgtadm.")
|
||||
fail("Unsupported iscsi helper: ${iscsi_helper}. The supported iscsi helper are tgtadm, iscsitarget.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,20 @@ describe 'nova::volume::iscsi' do
|
|||
)}
|
||||
end
|
||||
|
||||
describe 'and more specifically on debian os with iscsitarget helper' do
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian', :operatingsystem => 'Debian' }
|
||||
end
|
||||
let :params do
|
||||
{:iscsi_helper => 'iscsitarget'}
|
||||
end
|
||||
it { should contain_package('iscsitarget') }
|
||||
it { should contain_service('iscsitarget').with_enable(true) }
|
||||
it { should contain_service('open-iscsi').with_enable(true) }
|
||||
it { should contain_package('iscsitarget-dkms') }
|
||||
it { should contain_file('/etc/default/iscsitarget') }
|
||||
end
|
||||
|
||||
it { should contain_nova_config('volume_group').with_value('nova-volumes') }
|
||||
it { should_not contain_nova_config('iscsi_ip_address') }
|
||||
|
||||
|
|
Loading…
Reference in New Issue