1 # == Class: cinder::keystone::auth
3 # Configures Cinder user, service and endpoint in Keystone.
8 # Password for Cinder user. Required.
11 # Email for Cinder user. Optional. Defaults to 'cinder@localhost'.
14 # Username for Cinder service. Optional. Defaults to 'cinder'.
17 # Username for Cinder v2 service. Optional. Defaults to 'cinder2'.
19 # [*configure_endpoint*]
20 # Should Cinder endpoint be configured? Optional. Defaults to 'true'.
21 # API v1 endpoint should be enabled in Icehouse for compatibility with Nova.
23 # [*configure_endpoint_v2*]
24 # Should Cinder v2 endpoint be configured? Optional. Defaults to 'true'.
27 # Should the service user be configured? Optional. Defaults to 'true'.
29 # [*configure_user_role*]
30 # Should the admin role be configured for the service user?
31 # Optional. Defaults to 'true'.
34 # Type of service. Optional. Defaults to 'volume'.
37 # Type of API v2 service. Optional. Defaults to 'volume2'.
40 # Public address for endpoint. Optional. Defaults to '127.0.0.1'.
43 # Admin address for endpoint. Optional. Defaults to '127.0.0.1'.
45 # [*internal_address*]
46 # Internal address for endpoint. Optional. Defaults to '127.0.0.1'.
49 # Port for endpoint. Optional. Defaults to '8776'.
52 # Cinder API version. Optional. Defaults to 'v1'.
55 # Region for endpoint. Optional. Defaults to 'RegionOne'.
58 # Tenant for Cinder user. Optional. Defaults to 'services'.
61 # Protocol for public endpoint. Optional. Defaults to 'http'.
63 # [*internal_protocol*]
64 # Protocol for internal endpoint. Optional. Defaults to 'http'.
67 # Protocol for admin endpoint. Optional. Defaults to 'http'.
69 class cinder::keystone::auth (
71 $auth_name = 'cinder',
72 $auth_name_v2 = 'cinderv2',
73 $email = 'cinder@localhost',
75 $configure_endpoint = true,
76 $configure_endpoint_v2 = true,
77 $configure_user = true,
78 $configure_user_role = true,
79 $service_type = 'volume',
80 $service_type_v2 = 'volumev2',
81 $public_address = '127.0.0.1',
82 $admin_address = '127.0.0.1',
83 $internal_address = '127.0.0.1',
85 $volume_version = 'v1',
86 $region = 'RegionOne',
87 $public_protocol = 'http',
88 $admin_protocol = 'http',
89 $internal_protocol = 'http'
93 keystone_user { $auth_name:
95 password => $password,
101 if $configure_user_role {
102 Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'cinder-api' |>
104 keystone_user_role { "${auth_name}@${tenant}":
110 keystone_service { $auth_name:
112 type => $service_type,
113 description => 'Cinder Service',
115 keystone_service { $auth_name_v2:
117 type => $service_type_v2,
118 description => 'Cinder Service v2',
121 if $configure_endpoint {
122 keystone_endpoint { "${region}/${auth_name}":
124 public_url => "${public_protocol}://${public_address}:${port}/${volume_version}/%(tenant_id)s",
125 admin_url => "${admin_protocol}://${admin_address}:${port}/${volume_version}/%(tenant_id)s",
126 internal_url => "${internal_protocol}://${internal_address}:${port}/${volume_version}/%(tenant_id)s",
129 if $configure_endpoint_v2 {
130 keystone_endpoint { "${region}/${auth_name_v2}":
132 public_url => "${public_protocol}://${public_address}:${port}/v2/%(tenant_id)s",
133 admin_url => "${admin_protocol}://${admin_address}:${port}/v2/%(tenant_id)s",
134 internal_url => "${internal_protocol}://${internal_address}:${port}/v2/%(tenant_id)s",