Merge pull request #147 from dachary/master

add support for the 'iscsitarget' implementation of iscsi_helper
This commit is contained in:
Dan Bode 2012-09-06 13:22:25 -07:00
commit b3025d37a0
2 changed files with 41 additions and 1 deletions

View File

@ -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.")
}
}
}

View File

@ -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') }