Yanis Guenane ad1567ca5d Iscsi: Allow one to specify volumes_dir path
It is currently impossible to specify a volumes_dir for iscsi backend.
This commit allows one to specify it. Also it fixes the default
currently used[1] to map cinder defaults[2][3].

[1]
https://github.com/stackforge/puppet-cinder/blob/master/manifests/backend/iscsi.pp#L40
[2]
https://github.com/openstack/cinder/blob/master/cinder/volume/driver.py#L106
[3]
https://github.com/openstack/cinder/blob/master/cinder/common/config.py#L43

Change-Id: Ib49c4055198e895f7cc5b727db9bde93a5c92b8c
2015-03-11 15:53:48 +01:00

50 lines
1.4 KiB
Puppet

# == Class: cinder::volume::iscsi
#
# Configures Cinder volume ISCSI driver.
#
# === Parameters
#
# [*iscsi_ip_address*]
# (Required) The IP address that the iSCSI daemon is listening on
#
# [*volume_driver*]
# (Optional) Driver to use for volume creation
# Defaults to 'cinder.volume.drivers.lvm.LVMVolumeDriver'.
#
# [*volume_group*]
# (Optional) Name for the VG that will contain exported volumes
# Defaults to 'cinder-volumes'.
#
# [*volumes_dir*]
# (Optional) Volume configuration file storage directory
# Defaults to '/var/lib/cinder/volumes'.
#
# [*iscsi_helper*]
# (Optional) iSCSI target user-land tool to use.
# Defaults to '$::cinder::params::iscsi_helper'.
#
# [*iscsi_protocol*]
# (Optional) Protocol to use as iSCSI driver
# Defaults to 'iscsi'.
#
class cinder::volume::iscsi (
$iscsi_ip_address,
$volume_driver = 'cinder.volume.drivers.lvm.LVMVolumeDriver',
$volume_group = 'cinder-volumes',
$volumes_dir = '/var/lib/cinder/volumes',
$iscsi_helper = $::cinder::params::iscsi_helper,
$iscsi_protocol = 'iscsi'
) {
include ::cinder::params
cinder::backend::iscsi { 'DEFAULT':
iscsi_ip_address => $iscsi_ip_address,
volume_driver => $volume_driver,
volume_group => $volume_group,
volumes_dir => $volumes_dir,
iscsi_helper => $iscsi_helper,
iscsi_protocol => $iscsi_protocol
}
}