1 # ==Define: cinder::type_set
3 # Assigns keys after the volume type is set.
8 # (required) The keystone tenant:username password.
11 # (required) Accepts single name of type to set.
14 # (required) the key name that we are setting the value for.
17 # (optional) The keystone tenant name. Defaults to 'admin'.
20 # (optional) The keystone user name. Defaults to 'admin.
23 # (optional) The keystone auth url. Defaults to 'http://127.0.0.1:5000/v2.0/'.
26 # (optional) The keystone region name. Default is unset.
28 # Author: Andrew Woodward <awoodward@mirantis.com>
31 define cinder::type_set (
35 $os_tenant_name = 'admin',
36 $os_username = 'admin',
37 $os_auth_url = 'http://127.0.0.1:5000/v2.0/',
38 $os_region_name = undef,
41 # TODO: (xarses) This should be moved to a ruby provider so that among other
42 # reasons, the credential discovery magic can occur like in neutron.
45 "OS_TENANT_NAME=${os_tenant_name}",
46 "OS_USERNAME=${os_username}",
47 "OS_PASSWORD=${os_password}",
48 "OS_AUTH_URL=${os_auth_url}",
52 $region_env = ["OS_REGION_NAME=${os_region_name}"]
58 exec {"cinder type-key ${type} set ${key}=${name}":
59 path => ['/usr/bin', '/bin'],
60 command => "cinder type-key ${type} set ${key}=${name}",
61 unless => "cinder extra-specs-list | grep -Eq '\\b${type}\\b.*\\b${key}\\b.*\\b${name}\\b'",
62 environment => concat($cinder_env, $region_env),
63 require => Package['python-cinderclient']