[ansible][fedora] Update package name
[barometer.git] / puppet-barometer / manifests / keystone / auth.pp
1 # == Class: barometer::keystone::auth
2 #
3 # Configures barometer user, service and endpoint in Keystone.
4 #
5 # === Parameters
6 #
7 # [*password*]
8 #   (required) Password for barometer user.
9 #
10 # [*ensure*]
11 #   (optional) Ensure state of keystone service identity. Defaults to 'present'.
12 #
13 # [*auth_name*]
14 #   Username for barometer service. Defaults to 'barometer'.
15 #
16 # [*email*]
17 #   Email for barometer user. Defaults to 'barometer@localhost'.
18 #
19 # [*tenant*]
20 #   Tenant for barometer user. Defaults to 'services'.
21 #
22 # [*configure_endpoint*]
23 #   Should barometer endpoint be configured? Defaults to 'true'.
24 #
25 # [*configure_user*]
26 #   (Optional) Should the service user be configured?
27 #   Defaults to 'true'.
28 #
29 # [*configure_user_role*]
30 #   (Optional) Should the admin role be configured for the service user?
31 #   Defaults to 'true'.
32 #
33 # [*service_type*]
34 #   Type of service. Defaults to 'key-manager'.
35 #
36 # [*region*]
37 #   Region for endpoint. Defaults to 'RegionOne'.
38 #
39 # [*service_name*]
40 #   (optional) Name of the service.
41 #   Defaults to the value of 'barometer'.
42 #
43 # [*service_description*]
44 #   (optional) Description of the service.
45 #   Default to 'barometer NFV Service'
46 #
47 # [*public_url*]
48 #   (optional) The endpoint's public url. (Defaults to 'http://127.0.0.1:9890')
49 #   This url should *not* contain any trailing '/'.
50 #
51 # [*admin_url*]
52 #   (optional) The endpoint's admin url. (Defaults to 'http://127.0.0.1:9890')
53 #   This url should *not* contain any trailing '/'.
54 #
55 # [*internal_url*]
56 #   (optional) The endpoint's internal url. (Defaults to 'http://127.0.0.1:9890')
57 #
58 class barometer::keystone::auth (
59   $password,
60   $ensure              = 'present',
61   $auth_name           = 'barometer',
62   $email               = 'barometer@localhost',
63   $tenant              = 'services',
64   $configure_endpoint  = true,
65   $configure_user      = true,
66   $configure_user_role = true,
67   $service_name        = 'barometer',
68   $service_description = 'barometer NFV Service',
69   $service_type        = 'nfv-orchestration',
70   $region              = 'RegionOne',
71   $public_url          = 'http://127.0.0.1:9890',
72   $admin_url           = 'http://127.0.0.1:9890',
73   $internal_url        = 'http://127.0.0.1:9890',
74 ) {
75
76   if $configure_user_role {
77     Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'barometer-server' |>
78   }
79   Keystone_endpoint["${region}/${service_name}::${service_type}"]  ~> Service <| name == 'barometer-server' |>
80
81   keystone::resource::service_identity { 'barometer':
82     ensure              => $ensure,
83     configure_user      => $configure_user,
84     configure_user_role => $configure_user_role,
85     configure_endpoint  => $configure_endpoint,
86     service_name        => $service_name,
87     service_type        => $service_type,
88     service_description => $service_description,
89     region              => $region,
90     auth_name           => $auth_name,
91     password            => $password,
92     email               => $email,
93     tenant              => $tenant,
94     public_url          => $public_url,
95     internal_url        => $internal_url,
96     admin_url           => $admin_url,
97   }
98
99 }