puppet-cinder/manifests/type_set.pp
Andrew Woodward 209a5bd36a [bp] Add support for Cinder multi-backend
* Create class cinder::backend.
   Sets DEFAULT/enabled_backends

* Create define cinder::type.
   multip-purpose function to create type and optionally set extened
   information.

* Create define cinder::type_set.
   multi-purpose set function to set extended information.

* Copy rbd, iscsi, and nfs volume providers to support multi-backend
   Now provided as cinder::backend::<driver> to ensure that multi-backend
   aware resource is|[ not] used.

* Add rspec for new parts to ensure expected function.

Blueprint: cinder-volume-multi-backend

Change-Id: I6df9cadaad3b9ce2ab4b0e87dba9b5056459db10
2013-11-06 12:16:43 -08:00

52 lines
1.3 KiB
Puppet

# ==Define: cinder::type_set
#
# Assigns keys after the volume type is set.
#
# === Parameters
#
# [*os_password*]
# (required) The keystone tenant:username password.
#
# [*type*]
# (required) Accepts single name of type to set.
#
# [*key*]
# (required) the key name that we are setting the value for.
#
# [*os_tenant_name*]
# (optional) The keystone tenant name. Defaults to 'admin'.
#
# [*os_username*]
# (optional) The keystone user name. Defaults to 'admin.
#
# [*os_auth_url*]
# (optional) The keystone auth url. Defaults to 'http://127.0.0.1:5000/v2.0/'.
#
# Author: Andrew Woodward <awoodward@mirantis.com>
define cinder::type_set (
$type,
$key,
$os_password,
$os_tenant_name = 'admin',
$os_username = 'admin',
$os_auth_url = 'http://127.0.0.1:5000/v2.0/',
) {
# TODO: (xarses) This should be moved to a ruby provider so that among other
# reasons, the credential discovery magic can occur like in neutron.
exec {"cinder type-key ${type} set ${key}=${name}":
path => '/usr/bin',
command => "cinder type-key ${type} set ${key}=${name}",
environment => [
"OS_TENANT_NAME=${os_tenant_name}",
"OS_USERNAME=${os_username}",
"OS_PASSWORD=${os_password}",
"OS_AUTH_URL=${os_auth_url}",
],
require => Package['python-cinderclient']
}
}