backends: Add an extra_options door

Currently if a backend type parameter has not been specified in the
upstream module one needs to rely on a custom layer to enable them.
With this options even if not yet specified on the upstream module, user can
specify extra options for each backends.

Change-Id: I0387c86ff3e04a1d1c6b686f76d9c7c88c30a356
This commit is contained in:
Yanis Guenane 2015-03-11 11:28:07 +01:00
parent ccd470e95f
commit ab427c20b5
48 changed files with 541 additions and 18 deletions

View File

@ -35,6 +35,12 @@
# (optional) The state of the package
# Defaults to: 'present'
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'emc_vnx_backend/param1' => { 'value' => value1 } }
#
define cinder::backend::emc_vnx (
$iscsi_ip_address,
$san_ip,
@ -45,6 +51,7 @@ define cinder::backend::emc_vnx (
$package_ensure = 'present',
$san_login = 'admin',
$volume_backend_name = $name,
$extra_options = {},
) {
include ::cinder::params
@ -62,4 +69,6 @@ define cinder::backend::emc_vnx (
"${name}/volume_driver": value => 'cinder.volume.drivers.emc.emc_cli_iscsi.EMCCLIISCSIDriver';
}
create_resources('cinder_config', $extra_options)
}

View File

@ -49,6 +49,12 @@
# (optional) The maximum retry count for reconnection.
# Defaults to 5
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'eqlx_backend/param1' => { 'value' => value1 } }
#
define cinder::backend::eqlx (
$san_ip,
$san_login,
@ -62,6 +68,7 @@ define cinder::backend::eqlx (
$eqlx_chap_password = '12345',
$eqlx_cli_timeout = 30,
$eqlx_cli_max_retries = 5,
$extra_options = {},
) {
cinder_config {
"${name}/volume_backend_name": value => $volume_backend_name;
@ -83,4 +90,7 @@ define cinder::backend::eqlx (
"${name}/eqlx_chap_password": value => $eqlx_chap_password, secret => true;
}
}
create_resources('cinder_config', $extra_options)
}

View File

@ -28,6 +28,12 @@
# (optional) The config file to store the given $glusterfs_shares.
# Defaults to '/etc/cinder/shares.conf'
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'glusterfs_backend/param1' => { 'value' => value1 } }
#
# === Examples
#
# cinder::backend::glusterfs { 'myGluster':
@ -40,7 +46,8 @@ define cinder::backend::glusterfs (
$glusterfs_disk_util = false,
$glusterfs_sparsed_volumes = undef,
$glusterfs_mount_point_base = undef,
$glusterfs_shares_config = '/etc/cinder/shares.conf'
$glusterfs_shares_config = '/etc/cinder/shares.conf',
$extra_options = {},
) {
if $glusterfs_disk_util {
@ -63,4 +70,7 @@ define cinder::backend::glusterfs (
"${name}/glusterfs_sparsed_volumes": value => $glusterfs_sparsed_volumes;
"${name}/glusterfs_mount_point_base": value => $glusterfs_mount_point_base;
}
create_resources('cinder_config', $extra_options)
}

View File

@ -51,7 +51,13 @@
# (required) Time in hours until a snapshot expires. Must be more
# than hp3par_snapshot_retention.
# Defaults to 72.
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'h3par_iscsi_backend/param1' => { 'value' => value1 } }
#
define cinder::backend::hp3par_iscsi(
$hp3par_api_url,
$hp3par_username,
@ -66,6 +72,7 @@ define cinder::backend::hp3par_iscsi(
$hp3par_snap_cpg = 'OpenstackCPG',
$hp3par_snapshot_retention = 48,
$hp3par_snapshot_expiration = 72,
$extra_options = {},
) {
if ($hp3par_snapshot_expiration <= $hp3par_snapshot_retention) {
@ -87,4 +94,7 @@ define cinder::backend::hp3par_iscsi(
"${name}/hp3par_snapshot_retention": value => $hp3par_snapshot_retention;
"${name}/hp3par_snapshot_expiration": value => $hp3par_snapshot_expiration;
}
create_resources('cinder_config', $extra_options)
}

View File

@ -9,10 +9,17 @@
# [*volume_driver*]
# (Optional) Driver to use for volume creation
# Defaults to 'cinder.volume.drivers.lvm.LVMVolumeDriver'.
#
# [*volumes_dir*]
# (Optional) Volume configuration file storage directory
# Defaults to '/var/lib/cinder/volumes'.
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'iscsi_backend/param1' => { 'value' => value1 } }
#
define cinder::backend::iscsi (
$iscsi_ip_address,
$volume_backend_name = $name,
@ -21,6 +28,7 @@ define cinder::backend::iscsi (
$volumes_dir = '/var/lib/cinder/volumes',
$iscsi_helper = $::cinder::params::iscsi_helper,
$iscsi_protocol = 'iscsi',
$extra_options = {},
) {
include ::cinder::params
@ -35,6 +43,8 @@ define cinder::backend::iscsi (
"${name}/iscsi_protocol": value => $iscsi_protocol;
}
create_resources('cinder_config', $extra_options)
case $iscsi_helper {
'tgtadm': {
package { 'tgt':

View File

@ -136,6 +136,12 @@
# application.
# Defaults to '/devmgr/v2'
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'netapp_backend/param1' => { 'value' => value1 } }
#
# === Examples
#
# cinder::backend::netapp { 'myBackend':
@ -178,6 +184,7 @@ define cinder::backend::netapp (
$netapp_sa_password = '',
$netapp_storage_pools = '',
$netapp_webservice_path = '/devmgr/v2',
$extra_options = {},
) {
if $nfs_shares {
@ -219,4 +226,7 @@ define cinder::backend::netapp (
"${volume_backend_name}/use_multipath_for_image_xfer": value => true;
}
}
create_resources('cinder_config', $extra_options)
}

View File

@ -32,6 +32,12 @@
# [*nexenta_sparse*]
# (optional) Flag to create sparse volumes. Defaults to true.
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'nexenta_backend/param1' => { 'value' => value1 } }
#
define cinder::backend::nexenta (
$nexenta_user,
$nexenta_password,
@ -41,7 +47,8 @@ define cinder::backend::nexenta (
$nexenta_target_prefix = 'iqn:',
$nexenta_target_group_prefix = 'cinder/',
$nexenta_blocksize = '8k',
$nexenta_sparse = true
$nexenta_sparse = true,
$extra_options = {},
) {
cinder_config {
@ -56,4 +63,7 @@ define cinder::backend::nexenta (
"${name}/nexenta_sparse": value => $nexenta_sparse;
"${name}/volume_driver": value => 'cinder.volume.drivers.nexenta.volume.NexentaDriver';
}
create_resources('cinder_config', $extra_options)
}

View File

@ -43,6 +43,11 @@
# longer be valid.
# Defaults to '1.0'.
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'nfs_backend/param1' => { 'value' => value1 } }
#
define cinder::backend::nfs (
$volume_backend_name = $name,
@ -54,6 +59,7 @@ define cinder::backend::nfs (
$nfs_shares_config = '/etc/cinder/shares.conf',
$nfs_used_ratio = '0.95',
$nfs_oversub_ratio = '1.0',
$extra_options = {},
) {
file {$nfs_shares_config:
@ -74,4 +80,7 @@ define cinder::backend::nfs (
"${name}/nfs_used_ratio": value => $nfs_used_ratio;
"${name}/nfs_oversub_ratio": value => $nfs_oversub_ratio;
}
create_resources('cinder_config', $extra_options)
}

View File

@ -38,6 +38,12 @@
# A value of zero disables cloning
# Defaults to '5'
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'rbd_backend/param1' => { 'value' => value1 } }
#
define cinder::backend::rbd (
$rbd_pool,
$rbd_user,
@ -47,6 +53,7 @@ define cinder::backend::rbd (
$rbd_secret_uuid = false,
$volume_tmp_dir = false,
$rbd_max_clone_depth = '5',
$extra_options = {},
) {
include ::cinder::params
@ -73,6 +80,8 @@ define cinder::backend::rbd (
cinder_config {"${name}/volume_tmp_dir": ensure => absent;}
}
create_resources('cinder_config', $extra_options)
case $::osfamily {
'Debian': {
$override_line = "env CEPH_ARGS=\"--id ${rbd_user}\""

View File

@ -46,6 +46,12 @@
# [*ssh_min_pool_conn*]
# (optional) Maximum ssh connections in the pool.
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'san_backend/param1' => { 'value' => value1 } }
#
define cinder::backend::san (
$volume_driver,
$volume_backend_name = $name,
@ -59,7 +65,8 @@ define cinder::backend::san (
$san_is_local = false,
$ssh_conn_timeout = 30,
$ssh_min_pool_conn = 1,
$ssh_max_pool_conn = 5
$ssh_max_pool_conn = 5,
$extra_options = {},
) {
cinder_config {
@ -77,4 +84,7 @@ define cinder::backend::san (
"${name}/ssh_min_pool_conn": value => $ssh_min_pool_conn;
"${name}/ssh_max_pool_conn": value => $ssh_max_pool_conn;
}
create_resources('cinder_config', $extra_options)
}

View File

@ -38,6 +38,12 @@
# (optional) Port ID to use to connect to SolidFire API.
# Defaults to 443
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'solidfire_backend/param1' => { 'value' => value1 } }
#
define cinder::backend::solidfire(
$san_ip,
$san_login,
@ -47,7 +53,8 @@ define cinder::backend::solidfire(
$sf_emulate_512 = true,
$sf_allow_tenant_qos = false,
$sf_account_prefix = '',
$sf_api_port = '443'
$sf_api_port = '443',
$extra_options = {},
) {
cinder_config {
@ -61,4 +68,7 @@ define cinder::backend::solidfire(
"${name}/sf_account_prefix": value => $sf_account_prefix;
"${name}/sf_api_port": value => $sf_api_port;
}
create_resources('cinder_config', $extra_options)
}

View File

@ -49,6 +49,12 @@
# (optional) The name for the folder in the VC datacenter that will contain cinder volumes.
# Defaults to 'cinder-volumes'.
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'vmdk_backend/param1' => { 'value' => value1 } }
#
define cinder::backend::vmdk (
$host_ip,
$host_username,
@ -59,7 +65,8 @@ define cinder::backend::vmdk (
$max_object_retrieval = 100,
$task_poll_interval = 5,
$image_transfer_timeout_secs = 7200,
$wsdl_location = undef
$wsdl_location = undef,
$extra_options = {},
) {
cinder_config {
@ -84,4 +91,7 @@ define cinder::backend::vmdk (
package { 'python-suds':
ensure => present
}
create_resources('cinder_config', $extra_options)
}

View File

@ -33,6 +33,12 @@
# (Optonal) Default max number of LUNs in a storage group.
# Defaults to: '256'
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'emc_vnx_backend/param1' => { 'value' => value1 } }
#
class cinder::volume::emc_vnx(
$iscsi_ip_address,
$san_ip,
@ -42,6 +48,7 @@ class cinder::volume::emc_vnx(
$max_luns_per_storage_group = '256',
$package_ensure = 'present',
$san_login = 'admin',
$extra_options = {},
) {
cinder::backend::emc_vnx { 'DEFAULT':
@ -53,5 +60,7 @@ class cinder::volume::emc_vnx(
san_login => $san_login,
san_password => $san_password,
storage_vnx_pool_name => $storage_vnx_pool_name,
extra_options => $extra_options,
}
}

View File

@ -45,6 +45,12 @@
# (optional) The maximum retry count for reconnection.
# Defaults to 5
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'eqlx_backend/param1' => { 'value' => value1 } }
#
class cinder::volume::eqlx (
$san_ip,
$san_login,
@ -57,6 +63,7 @@ class cinder::volume::eqlx (
$eqlx_chap_password = '12345',
$eqlx_cli_timeout = 30,
$eqlx_cli_max_retries = 5,
$extra_options = {},
) {
cinder::backend::eqlx { 'DEFAULT':
san_ip => $san_ip,
@ -70,5 +77,6 @@ class cinder::volume::eqlx (
eqlx_chap_password => $eqlx_chap_password,
eqlx_cli_timeout => $eqlx_cli_timeout,
eqlx_cli_max_retries => $eqlx_cli_max_retries,
extra_options => $extra_options,
}
}

View File

@ -24,6 +24,12 @@
# (optional) The config file to store the given $glusterfs_shares.
# Defaults to '/etc/cinder/shares.conf'
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'glusterfs_backend/param1' => { 'value' => value1 } }
#
# === Examples
#
# class { 'cinder::volume::glusterfs':
@ -35,7 +41,8 @@ class cinder::volume::glusterfs (
$glusterfs_disk_util = false,
$glusterfs_sparsed_volumes = undef,
$glusterfs_mount_point_base = undef,
$glusterfs_shares_config = '/etc/cinder/shares.conf'
$glusterfs_shares_config = '/etc/cinder/shares.conf',
$extra_options = {},
) {
cinder::backend::glusterfs { 'DEFAULT':
@ -44,5 +51,6 @@ class cinder::volume::glusterfs (
glusterfs_sparsed_volumes => $glusterfs_sparsed_volumes,
glusterfs_mount_point_base => $glusterfs_mount_point_base,
glusterfs_shares_config => $glusterfs_shares_config,
extra_options => $extra_options,
}
}

View File

@ -41,7 +41,13 @@
#
# [*hp3par_snapshot_expiration*]
# (required) setting to 72 hours as default (must be larger than retention)
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'h3par_iscsi_backend/param1' => { 'value' => value1 } }
#
class cinder::volume::hp3par_iscsi(
$hp3par_api_url,
$hp3par_username,
@ -55,6 +61,7 @@ class cinder::volume::hp3par_iscsi(
$hp3par_snap_cpg = OpenstackCPG,
$hp3par_snapshot_retention = 48,
$hp3par_snapshot_expiration = 72,
$extra_options = {},
) {
cinder::backend::hp3par_iscsi { 'DEFAULT':
@ -69,5 +76,6 @@ class cinder::volume::hp3par_iscsi(
hp3par_snap_cpg => $hp3par_snap_cpg,
hp3par_snapshot_retention => $hp3par_snapshot_retention,
hp3par_snapshot_expiration => $hp3par_snapshot_expiration,
extra_options => $extra_options,
}
}

View File

@ -27,13 +27,20 @@
# (Optional) Protocol to use as iSCSI driver
# Defaults to 'iscsi'.
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'iscsi_backend/param1' => { 'value' => value1 } }
#
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'
$iscsi_protocol = 'iscsi',
$extra_options = {},
) {
include ::cinder::params
@ -44,6 +51,7 @@ class cinder::volume::iscsi (
volume_group => $volume_group,
volumes_dir => $volumes_dir,
iscsi_helper => $iscsi_helper,
iscsi_protocol => $iscsi_protocol
iscsi_protocol => $iscsi_protocol,
extra_options => $extra_options,
}
}

View File

@ -134,6 +134,12 @@
# application.
# Defaults to '/devmgr/v2'
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'netapp_backend/param1' => { 'value' => value1 } }
#
# === Examples
#
# class { 'cinder::volume::netapp':
@ -175,6 +181,7 @@ class cinder::volume::netapp (
$netapp_sa_password = '',
$netapp_storage_pools = '',
$netapp_webservice_path = '/devmgr/v2',
$extra_options = {},
) {
cinder::backend::netapp { 'DEFAULT':
@ -199,5 +206,6 @@ class cinder::volume::netapp (
netapp_sa_password => $netapp_sa_password,
netapp_storage_pools => $netapp_storage_pools,
netapp_webservice_path => $netapp_webservice_path,
extra_options => $extra_options,
}
}

View File

@ -28,6 +28,12 @@
# [*nexenta_sparse*]
# (optional) Flag to create sparse volumes. Defaults to true.
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'nexenta_backend/param1' => { 'value' => value1 } }
#
class cinder::volume::nexenta (
$nexenta_user,
$nexenta_password,
@ -36,7 +42,8 @@ class cinder::volume::nexenta (
$nexenta_target_prefix = 'iqn:',
$nexenta_target_group_prefix = 'cinder/',
$nexenta_blocksize = '8k',
$nexenta_sparse = true
$nexenta_sparse = true,
$extra_options = {},
) {
cinder::backend::nexenta { 'DEFAULT':
@ -48,5 +55,6 @@ class cinder::volume::nexenta (
nexenta_target_group_prefix => $nexenta_target_group_prefix,
nexenta_blocksize => $nexenta_blocksize,
nexenta_sparse => $nexenta_sparse,
extra_options => $extra_options,
}
}

View File

@ -40,6 +40,11 @@
# longer be valid.
# Defaults to '1.0'.
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'nfs_backend/param1' => { 'value' => value1 } }
#
class cinder::volume::nfs (
$nfs_servers = [],
@ -50,6 +55,7 @@ class cinder::volume::nfs (
$nfs_shares_config = '/etc/cinder/shares.conf',
$nfs_used_ratio = '0.95',
$nfs_oversub_ratio = '1.0',
$extra_options = {},
) {
cinder::backend::nfs { 'DEFAULT':
@ -61,5 +67,6 @@ class cinder::volume::nfs (
nfs_shares_config => $nfs_shares_config,
nfs_used_ratio => $nfs_used_ratio,
nfs_oversub_ratio => $nfs_oversub_ratio,
extra_options => $extra_options,
}
}

View File

@ -33,6 +33,12 @@
# A value of zero disables cloning
# Defaults to '5'
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'rbd_backend/param1' => { 'value' => value1 } }
#
class cinder::volume::rbd (
$rbd_pool,
$rbd_user,
@ -41,6 +47,7 @@ class cinder::volume::rbd (
$rbd_secret_uuid = false,
$volume_tmp_dir = false,
$rbd_max_clone_depth = '5',
$extra_options = {},
) {
cinder::backend::rbd { 'DEFAULT':
@ -51,5 +58,6 @@ class cinder::volume::rbd (
rbd_secret_uuid => $rbd_secret_uuid,
volume_tmp_dir => $volume_tmp_dir,
rbd_max_clone_depth => $rbd_max_clone_depth,
extra_options => $extra_options,
}
}

View File

@ -49,6 +49,12 @@
# (Optional) Maximum ssh connections in the pool.
# Defaults to '5'.
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'san_backend/param1' => { 'value' => value1 } }
#
class cinder::volume::san (
$volume_driver,
$san_thin_provision = true,
@ -61,7 +67,8 @@ class cinder::volume::san (
$san_is_local = false,
$ssh_conn_timeout = 30,
$ssh_min_pool_conn = 1,
$ssh_max_pool_conn = 5
$ssh_max_pool_conn = 5,
$extra_options = {},
) {
cinder::backend::san { 'DEFAULT':
@ -77,5 +84,6 @@ class cinder::volume::san (
ssh_conn_timeout => $ssh_conn_timeout,
ssh_min_pool_conn => $ssh_min_pool_conn,
ssh_max_pool_conn => $ssh_max_pool_conn,
extra_options => $extra_options,
}
}

View File

@ -34,6 +34,12 @@
# (optional) Port ID to use to connect to SolidFire API.
# Defaults to 443
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'solidfire_backend/param1' => { 'value' => value1 } }
#
class cinder::volume::solidfire(
$san_ip,
$san_login,
@ -42,7 +48,8 @@ class cinder::volume::solidfire(
$sf_emulate_512 = true,
$sf_allow_tenant_qos = false,
$sf_account_prefix = '',
$sf_api_port = '443'
$sf_api_port = '443',
$extra_options = {},
) {
cinder::backend::solidfire { 'DEFAULT':
@ -54,5 +61,6 @@ class cinder::volume::solidfire(
sf_allow_tenant_qos => $sf_allow_tenant_qos,
sf_account_prefix => $sf_account_prefix,
sf_api_port => $sf_api_port,
extra_options => $extra_options,
}
}

View File

@ -45,7 +45,12 @@
# (optional) The name for the folder in the VC datacenter that will contain cinder volumes.
# Defaults to 'cinder-volumes'.
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'vmdk_backend/param1' => { 'value' => value1 } }
#
class cinder::volume::vmdk(
$host_ip,
$host_username,
@ -55,7 +60,8 @@ class cinder::volume::vmdk(
$max_object_retrieval = 100,
$task_poll_interval = 5,
$image_transfer_timeout_secs = 7200,
$wsdl_location = undef
$wsdl_location = undef,
$extra_options = {},
) {
cinder::backend::vmdk { 'DEFAULT':
@ -68,5 +74,6 @@ class cinder::volume::vmdk(
task_poll_interval => $task_poll_interval,
image_transfer_timeout_secs => $image_transfer_timeout_secs,
wsdl_location => $wsdl_location,
extra_options => $extra_options,
}
}

View File

@ -29,4 +29,18 @@ describe 'cinder::volume::emc_vnx' do
should contain_cinder_config('DEFAULT/storage_vnx_pool_name').with_value('emc-storage-pool')
end
end
describe 'emc vnx volume driver with additional configuration' do
before :each do
params.merge!({:extra_options => {'emc_vnx_backend/param1' => {'value' => 'value1'}}})
end
it 'configure emc vnx volume with additional configuration' do
should contain_cinder__backend__emc_vnx('DEFAULT').with({
:extra_options => {'emc_vnx_backend/param1' => {'value' => 'value1'}}
})
end
end
end

View File

@ -32,4 +32,17 @@ describe 'cinder::volume::eqlx' do
end
end
describe 'eqlx volume driver with additional configuration' do
before :each do
params.merge!({:extra_options => {'eqlx_backend/param1' => {'value' => 'value1'}}})
end
it 'configure eqlx volume with additional configuration' do
should contain_cinder__backend__eqlx('DEFAULT').with({
:extra_options => {'eqlx_backend/param1' => {'value' => 'value1'}}
})
end
end
end

View File

@ -38,6 +38,19 @@ describe 'cinder::volume::glusterfs' do
expect { subject }.to raise_error(Puppet::Error, /glusterfs_disk_util is removed in Icehouse./)
end
end
context 'glusterfs volume driver with additional configuration' do
before do
params.merge!({:extra_options => {'glusterfs_backend/param1' => { 'value' => 'value1' }}})
end
it 'configure glusterfs volume with additional configuration' do
should contain_cinder__backend__glusterfs('DEFAULT').with({
:extra_options => {'glusterfs_backend/param1' => {'value' => 'value1'}}
})
end
end
end
context 'on Debian platforms' do

View File

@ -29,4 +29,17 @@ describe 'cinder::volume::hp3par_iscsi' do
should contain_cinder_config('DEFAULT/san_password').with_value('password')
end
end
describe 'hp3par_iscsi volume driver with additional configuration' do
before :each do
params.merge!({:extra_options => {'hp3par_iscsi_backend/param1' => {'value' => 'value1'}}})
end
it 'configure hp3par_iscsi volume with additional configuration' do
should contain_cinder__backend__hp3par_iscsi('DEFAULT').with({
:extra_options => {'hp3par_iscsi_backend/param1' => {'value' => 'value1'}}
})
end
end
end

View File

@ -87,4 +87,14 @@ describe 'cinder::volume::iscsi' do
end
describe 'iscsi volume driver with additional configuration' do
let(:params) { req_params.merge({:extra_options => {'iscsi_backend/param1' => {'value' => 'value1'}}}) }
it 'configure iscsi volume with additional configuration' do
should contain_cinder__backend__iscsi('DEFAULT').with({
:extra_options => {'iscsi_backend/param1' => {'value' => 'value1'}}
})
end
end
end

View File

@ -79,4 +79,17 @@ describe 'cinder::volume::netapp' do
.with_content("10.0.0.1:/test1\n10.0.0.2:/test2")
end
end
context 'with netapp volume drivers additional configuration' do
before do
params.merge!({:extra_options => {'netapp_backend/param1' => { 'value' => 'value1' }}})
end
it 'configure netapp volume with additional configuration' do
should contain_cinder__backend__netapp('DEFAULT').with({
:extra_options => {'netapp_backend/param1' => {'value' => 'value1'}}
})
end
end
end

View File

@ -8,7 +8,8 @@ describe 'cinder::volume::nexenta' do
let :params do
{ :nexenta_user => 'nexenta',
:nexenta_password => 'password',
:nexenta_host => '127.0.0.2' }
:nexenta_host => '127.0.0.2',
}
end
let :default_params do
@ -19,6 +20,7 @@ describe 'cinder::volume::nexenta' do
:nexenta_sparse => true }
end
let :facts do
{ :osfamily => 'Debian' }
end
@ -40,4 +42,17 @@ describe 'cinder::volume::nexenta' do
end
end
context 'nexenta volume drive with additional configuration' do
before :each do
params.merge!({:extra_options => {'nexenta_backend/param1' => {'value' => 'value1'}}})
end
it 'configure nexenta volume with additional configuration' do
should contain_cinder__backend__nexenta('DEFAULT').with({
:extra_options => {'nexenta_backend/param1' => {'value' => 'value1'}}
})
end
end
end

View File

@ -40,4 +40,18 @@ describe 'cinder::volume::nfs' do
)
end
end
describe 'nfs volume driver with additional configuration' do
before :each do
params.merge!({:extra_options => {'nfs_backend/param1' => {'value' => 'value1'}}})
end
it 'configure nfs volume with additional configuration' do
should contain_cinder__backend__nfs('DEFAULT').with({
:extra_options => {'nfs_backend/param1' => {'value' => 'value1'}}
})
end
end
end

View File

@ -53,6 +53,16 @@ describe 'cinder::volume::rbd' do
end
describe 'rbd volume driver with additional configuration' do
before :each do
params.merge!({:extra_options => {'rbd_backend/param1' => {'value' => 'value1'}}})
end
it 'configure rbd volume with additional configuration' do
should contain_cinder__backend__rbd('DEFAULT').with({
:extra_options => {'rbd_backend/param1' => {'value' => 'value1'}}
})
end
end
describe 'with RedHat' do
let :facts do

View File

@ -7,7 +7,8 @@ describe 'cinder::volume::san' do
:san_ip => '127.0.0.1',
:san_login => 'cluster_operator',
:san_password => '007',
:san_clustername => 'storage_cluster' }
:san_clustername => 'storage_cluster',
}
end
let :default_params do
@ -41,4 +42,17 @@ describe 'cinder::volume::san' do
context 'with parameters' do
it_configures 'a san volume driver'
end
context 'san volume driver with additional configuration' do
before :each do
params.merge!({:extra_options => { 'san_backend/param1' => {'value' => 'value1'}}})
end
it 'configure san volume with additional configuration' do
should contain_cinder__backend__san('DEFAULT').with({
:extra_options => {'san_backend/param1' => {'value' => 'value1'}}
})
end
end
end

View File

@ -26,4 +26,17 @@ describe 'cinder::volume::solidfire' do
end
end
describe 'solidfire volume driver with additional configuration' do
before :each do
params.merge!({:extra_options => {'solidfire_backend/param1' => {'value' => 'value1'}}})
end
it 'configure solidfire volume with additional configuration' do
should contain_cinder__backend__solidfire('DEFAULT').with({
:extra_options => {'solidfire_backend/param1' => {'value' => 'value1'}}
})
end
end
end

View File

@ -17,7 +17,8 @@ describe 'cinder::volume::vmdk' do
:max_object_retrieval => 200,
:task_poll_interval => 10,
:image_transfer_timeout_secs => 3600,
:wsdl_location => 'http://127.0.0.1:8080/vmware/SDK/wsdl/vim25/vimService.wsdl'
:wsdl_location => 'http://127.0.0.1:8080/vmware/SDK/wsdl/vim25/vimService.wsdl',
:extra_options => { 'vmdk_backend/param1' => { 'value' => 'value1' }}
}
end
@ -58,4 +59,18 @@ describe 'cinder::volume::vmdk' do
should contain_cinder_config('DEFAULT/vmware_wsdl_location').with_value(params[:wsdl_location])
end
end
context 'vmdk volume driver with additional configuration' do
before :each do
params.merge!({:extra_options => { 'vmdk_backend/param1' => { 'value' => 'value1' }}})
end
it 'configure vmdk volume with additional configuration' do
should contain_cinder__backend__vmdk('DEFAULT').with({
:extra_options => {'vmdk_backend/param1' => {'value' => 'value1'}}
})
end
end
end

View File

@ -31,4 +31,17 @@ describe 'cinder::backend::emc_vnx' do
should contain_cinder_config('emc/storage_vnx_pool_name').with_value('emc-storage-pool')
end
end
describe 'emc vnx backend with additional configuration' do
before :each do
params.merge!({:extra_options => {'emc/param1' => {'value' => 'value1'}}})
end
it 'configure emc vnx backend with additional configuration' do
should contain_cinder_config('emc/param1').with({
:value => 'value1',
})
end
end
end

View File

@ -33,4 +33,17 @@ describe 'cinder::backend::eqlx' do
end
end
end
describe 'eqlx backend with additional configuration' do
before :each do
params.merge!({:extra_options => {'eqlx-1/param1' => {'value' => 'value1'}}})
end
it 'configure eqlx backend with additional configuration' do
should contain_cinder_config('eqlx-1/param1').with({
:value => 'value1',
})
end
end
end

View File

@ -40,6 +40,19 @@ describe 'cinder::backend::glusterfs' do
expect { subject }.to raise_error(Puppet::Error, /glusterfs_disk_util is removed in Icehouse./)
end
end
context 'glusterfs backend with additional configuration' do
before do
params.merge!({:extra_options => {'mygluster/param1' => { 'value' => 'value1' }}})
end
it 'configure glusterfs backend with additional configuration' do
should contain_cinder_config('mygluster/param1').with({
:value => 'value1'
})
end
end
end
context 'on Debian platforms' do

View File

@ -31,4 +31,17 @@ describe 'cinder::backend::hp3par_iscsi' do
should contain_cinder_config('hp3par_iscsi/san_password').with_value('password')
end
end
describe 'hp3par_iscsi backend with additional configuration' do
before :each do
params.merge!({:extra_options => {'hp3par_iscsi/param1' => {'value' => 'value1'}}})
end
it 'configure hp3par_iscsi backend with additional configuration' do
should contain_cinder_config('hp3par_iscsi/param1').with({
:value => 'value1',
})
end
end
end

View File

@ -69,6 +69,18 @@ describe 'cinder::backend::iscsi' do
end
end
describe 'iscsi backend with additional configuration' do
before :each do
params.merge!({:extra_options => {'hippo/param1' => {'value' => 'value1'}}})
end
it 'configure iscsi backend with additional configuration' do
should contain_cinder_config('hippo/param1').with({
:value => 'value1',
})
end
end
describe 'with RedHat' do
let :facts do

View File

@ -78,6 +78,18 @@ describe 'cinder::backend::netapp' do
it { should contain_cinder_config("#{req_params[:volume_backend_name]}/use_multipath_for_image_xfer").with_value('true') }
end
context 'netapp backend with additional configuration' do
before do
params.merge!({:extra_options => {'hippo/param1' => { 'value' => 'value1' }}})
end
it 'configure netapp backend with additional configuration' do
should contain_cinder_config('hippo/param1').with({
:value => 'value1'
})
end
end
context 'with NFS shares provided' do
let (:req_params) { params.merge!({
:nfs_shares => ['10.0.0.1:/test1', '10.0.0.2:/test2'],

View File

@ -36,4 +36,17 @@ describe 'cinder::backend::nexenta' do
end
end
end
context 'nexenta backend with additional configuration' do
before do
params.merge!({:extra_options => {'nexenta/param1' => { 'value' => 'value1' }}})
end
it 'configure nexenta backend with additional configuration' do
should contain_cinder_config('nexenta/param1').with({
:value => 'value1'
})
end
end
end

View File

@ -45,4 +45,17 @@ describe 'cinder::backend::nfs' do
)
end
end
describe 'nfs backend with additional configuration' do
before :each do
params.merge!({:extra_options => {'hippo/param1' => {'value' => 'value1'}}})
end
it 'configure nfs backend with additional configuration' do
should contain_cinder_config('hippo/param1').with({
:value => 'value1',
})
end
end
end

View File

@ -69,6 +69,19 @@ describe 'cinder::backend::rbd' do
it { should contain_cinder_config("ceph2/rbd_pool").with_value('volumes2') }
it { should contain_cinder_config("ceph2/rbd_user").with_value('test') }
end
context 'rbd backend with additional configuration' do
before do
params.merge!({:extra_options => {'rbd-ssd/param1' => { 'value' => 'value1' }}})
end
it 'configure rbd backend with additional configuration' do
should contain_cinder_config('rbd-ssd/param1').with({
:value => 'value1'
})
end
end
end
describe 'with RedHat' do

View File

@ -37,4 +37,17 @@ describe 'cinder::backend::san' do
context 'with parameters' do
it_configures 'a san volume driver'
end
context 'san backend with additional configuration' do
before do
params.merge!({:extra_options => {'mysan/param1' => { 'value' => 'value1' }}})
end
it 'configure san backend with additional configuration' do
should contain_cinder_config('mysan/param1').with({
:value => 'value1'
})
end
end
end

View File

@ -27,4 +27,17 @@ describe 'cinder::backend::solidfire' do
'password')
end
end
describe 'solidfire backend with additional configuration' do
before :each do
params.merge!({:extra_options => {'solidfire/param1' => {'value' => 'value1'}}})
end
it 'configure solidfire backend with additional configuration' do
should contain_cinder_config('solidfire/param1').with({
:value => 'value1',
})
end
end
end

View File

@ -56,4 +56,17 @@ describe 'cinder::backend::vmdk' do
should contain_cinder_config('hippo/vmware_wsdl_location').with_value(params[:wsdl_location])
end
end
context 'vmdk backend with additional configuration' do
before do
params.merge!({:extra_options => {'hippo/param1' => { 'value' => 'value1' }}})
end
it 'configure vmdk backend with additional configuration' do
should contain_cinder_config('hippo/param1').with({
:value => 'value1'
})
end
end
end