2 # Sets up glance users, service and endpoint
6 # $auth_name :: identifier used for all keystone objects related to glance.
7 # Optional. Defaults to glance.
8 # $password :: password for glance user. Optional. Defaults to glance_password.
9 # $configure_user :: Whether to configure a service user. Optional. Defaults to true.
10 # $configure_user_role :: Whether to configure the admin role for the service user.
11 # Optional. Defaults to true.
12 # $service_name :: name of the service. Optional. Defaults to value of auth_name.
13 # $service_type :: type of service to create. Optional. Defaults to image.
14 # $public_address :: Public address for endpoint. Optional. Defaults to 127.0.0.1.
15 # $admin_address :: Admin address for endpoint. Optional. Defaults to 127.0.0.1.
16 # $inernal_address :: Internal address for endpoint. Optional. Defaults to 127.0.0.1.
17 # $port :: Port for endpoint. Needs to match glance api service port. Optional.
19 # $region :: Region where endpoint is set.
20 # $public_protocol :: Protocol for public endpoint. Optional. Defaults to http.
21 # $admin_protocol :: Protocol for admin endpoint. Optional. Defaults to http.
22 # $internal_protocol :: Protocol for internal endpoint. Optional. Defaults to http.
24 class glance::keystone::auth(
26 $email = 'glance@localhost',
27 $auth_name = 'glance',
28 $configure_endpoint = true,
29 $configure_user = true,
30 $configure_user_role = true,
31 $service_name = undef,
32 $service_type = 'image',
33 $public_address = '127.0.0.1',
34 $admin_address = '127.0.0.1',
35 $internal_address = '127.0.0.1',
37 $region = 'RegionOne',
39 $public_protocol = 'http',
40 $admin_protocol = 'http',
41 $internal_protocol = 'http'
44 if $service_name == undef {
45 $real_service_name = $auth_name
47 $real_service_name = $service_name
50 if $configure_endpoint {
51 Keystone_endpoint["${region}/${real_service_name}"] ~> Service <| name == 'glance-api' |>
55 keystone_user { $auth_name:
57 password => $password,
63 if $configure_user_role {
64 Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'glance-registry' |>
65 Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'glance-api' |>
67 keystone_user_role { "${auth_name}@${tenant}":
73 keystone_service { $real_service_name:
75 type => $service_type,
76 description => 'Openstack Image Service',
79 if $configure_endpoint {
80 keystone_endpoint { "${region}/${real_service_name}":
82 public_url => "${public_protocol}://${public_address}:${port}",
83 admin_url => "${admin_protocol}://${admin_address}:${port}",
84 internal_url => "${internal_protocol}://${internal_address}:${port}",