puppet-barometer: add puppet module to barometer
[barometer.git] / puppet-barometer / manifests / keystone / authtoken.pp
1 # class: barometer::keystone::auth
2 #
3 # Configure the keystone_authtoken section in the configuration file
4 #
5 # === Parameters
6 #
7 # [*username*]
8 #   (Optional) The name of the service user
9 #   Defaults to 'barometer'
10 #
11 # [*password*]
12 #   (Required) Password to create for the service user
13 #
14 # [*auth_url*]
15 #   (Optional) The URL to use for authentication.
16 #   Defaults to 'http://localhost:35357'.
17 #
18 # [*project_name*]
19 #   (Optional) Service project name
20 #   Defaults to 'services'
21 #
22 # [*user_domain_name*]
23 #   (Optional) Name of domain for $username
24 #   Defaults to $::os_service_default
25 #
26 # [*project_domain_name*]
27 #   (Optional) Name of domain for $project_name
28 #   Defaults to $::os_service_default
29 #
30 # [*insecure*]
31 #   (Optional) If true, explicitly allow TLS without checking server cert
32 #   against any certificate authorities.  WARNING: not recommended.  Use with
33 #   caution.
34 #   Defaults to $:os_service_default
35 #
36 # [*auth_section*]
37 #   (Optional) Config Section from which to load plugin specific options
38 #   Defaults to $::os_service_default.
39 #
40 # [*auth_type*]
41 #   (Optional) Authentication type to load
42 #   Defaults to 'password'.
43 #
44 # [*auth_uri*]
45 #   (Optional) Complete public Identity API endpoint.
46 #   Defaults to 'http://localhost:5000'.
47 #
48 # [*auth_version*]
49 #   (Optional) API version of the admin Identity API endpoint.
50 #   Defaults to $::os_service_default.
51 #
52 # [*cache*]
53 #   (Optional) Env key for the swift cache.
54 #   Defaults to $::os_service_default.
55 #
56 # [*cafile*]
57 #   (Optional) A PEM encoded Certificate Authority to use when verifying HTTPs
58 #   connections.
59 #   Defaults to $::os_service_default.
60 #
61 # [*certfile*]
62 #   (Optional) Required if identity server requires client certificate
63 #   Defaults to $::os_service_default.
64 #
65 # [*check_revocations_for_cached*]
66 #   (Optional) If true, the revocation list will be checked for cached tokens.
67 #   This requires that PKI tokens are configured on the identity server.
68 #   boolean value.
69 #   Defaults to $::os_service_default.
70 #
71 # [*delay_auth_decision*]
72 #   (Optional) Do not handle authorization requests within the middleware, but
73 #   delegate the authorization decision to downstream WSGI components. Boolean
74 #   value
75 #   Defaults to $::os_service_default.
76 #
77 # [*enforce_token_bind*]
78 #   (Optional) Used to control the use and type of token binding. Can be set
79 #   to: "disabled" to not check token binding. "permissive" (default) to
80 #   validate binding information if the bind type is of a form known to the
81 #   server and ignore it if not. "strict" like "permissive" but if the bind
82 #   type is unknown the token will be rejected. "required" any form of token
83 #   binding is needed to be allowed. Finally the name of a binding method that
84 #   must be present in tokens. String value.
85 #   Defaults to $::os_service_default.
86 #
87 # [*hash_algorithms*]
88 #   (Optional) Hash algorithms to use for hashing PKI tokens. This may be a
89 #   single algorithm or multiple. The algorithms are those supported by Python
90 #   standard hashlib.new(). The hashes will be tried in the order given, so put
91 #   the preferred one first for performance. The result of the first hash will
92 #   be stored in the cache. This will typically be set to multiple values only
93 #   while migrating from a less secure algorithm to a more secure one. Once all
94 #   the old tokens are expired this option should be set to a single value for
95 #   better performance. List value.
96 #   Defaults to $::os_service_default.
97 #
98 # [*http_connect_timeout*]
99 #   (Optional) Request timeout value for communicating with Identity API
100 #   server.
101 #   Defaults to $::os_service_default.
102 #
103 # [*http_request_max_retries*]
104 #   (Optional) How many times are we trying to reconnect when communicating
105 #   with Identity API Server. Integer value
106 #   Defaults to $::os_service_default.
107 #
108 # [*include_service_catalog*]
109 #   (Optional) Indicate whether to set the X-Service-Catalog header. If False,
110 #   middleware will not ask for service catalog on token validation and will
111 #   not set the X-Service-Catalog header. Boolean value.
112 #   Defaults to $::os_service_default.
113 #
114 # [*keyfile*]
115 #   (Optional) Required if identity server requires client certificate
116 #   Defaults to $::os_service_default.
117 #
118 # [*memcache_pool_conn_get_timeout*]
119 #   (Optional) Number of seconds that an operation will wait to get a memcached
120 #   client connection from the pool. Integer value
121 #   Defaults to $::os_service_default.
122 #
123 # [*memcache_pool_dead_retry*]
124 #   (Optional) Number of seconds memcached server is considered dead before it
125 #   is tried again. Integer value
126 #   Defaults to $::os_service_default.
127 #
128 # [*memcache_pool_maxsize*]
129 #   (Optional) Maximum total number of open connections to every memcached
130 #   server. Integer value
131 #   Defaults to $::os_service_default.
132 #
133 # [*memcache_pool_socket_timeout*]
134 #   (Optional) Number of seconds a connection to memcached is held unused in
135 #   the pool before it is closed. Integer value
136 #   Defaults to $::os_service_default.
137 #
138 # [*memcache_pool_unused_timeout*]
139 #   (Optional) Number of seconds a connection to memcached is held unused in
140 #   the pool before it is closed. Integer value
141 #   Defaults to $::os_service_default.
142 #
143 # [*memcache_secret_key*]
144 #   (Optional, mandatory if memcache_security_strategy is defined) This string
145 #   is used for key derivation.
146 #   Defaults to $::os_service_default.
147 #
148 # [*memcache_security_strategy*]
149 #   (Optional) If defined, indicate whether token data should be authenticated
150 #   or authenticated and encrypted. If MAC, token data is authenticated (with
151 #   HMAC) in the cache. If ENCRYPT, token data is encrypted and authenticated in the
152 #   cache. If the value is not one of these options or empty, auth_token will
153 #   raise an exception on initialization.
154 #   Defaults to $::os_service_default.
155 #
156 # [*memcache_use_advanced_pool*]
157 #   (Optional)  Use the advanced (eventlet safe) memcached client pool. The
158 #   advanced pool will only work under python 2.x Boolean value
159 #   Defaults to $::os_service_default.
160 #
161 # [*memcached_servers*]
162 #   (Optional) Optionally specify a list of memcached server(s) to use for
163 #   caching. If left undefined, tokens will instead be cached in-process.
164 #   Defaults to $::os_service_default.
165 #
166 # [*manage_memcache_package*]
167 #  (Optional) Whether to install the python-memcache package.
168 #  Defaults to false.
169 #
170 # [*region_name*]
171 #   (Optional) The region in which the identity server can be found.
172 #   Defaults to $::os_service_default.
173 #
174 # [*revocation_cache_time*]
175 #   (Optional) Determines the frequency at which the list of revoked tokens is
176 #   retrieved from the Identity service (in seconds). A high number of
177 #   revocation events combined with a low cache duration may significantly
178 #   reduce performance. Only valid for PKI tokens. Integer value
179 #   Defaults to $::os_service_default.
180 #
181 # [*token_cache_time*]
182 #   (Optional) In order to prevent excessive effort spent validating tokens,
183 #   the middleware caches previously-seen tokens for a configurable duration
184 #   (in seconds). Set to -1 to disable caching completely. Integer value
185 #   Defaults to $::os_service_default.
186 #
187 class barometer::keystone::authtoken(
188   $password,
189   $username                       = 'barometer',
190   $auth_url                       = 'http://localhost:35357',
191   $project_name                   = 'services',
192   $user_domain_name               = $::os_service_default,
193   $project_domain_name            = $::os_service_default,
194   $insecure                       = $::os_service_default,
195   $auth_section                   = $::os_service_default,
196   $auth_type                      = 'password',
197   $auth_uri                       = 'http://localhost:5000',
198   $auth_version                   = $::os_service_default,
199   $cache                          = $::os_service_default,
200   $cafile                         = $::os_service_default,
201   $certfile                       = $::os_service_default,
202   $check_revocations_for_cached   = $::os_service_default,
203   $delay_auth_decision            = $::os_service_default,
204   $enforce_token_bind             = $::os_service_default,
205   $hash_algorithms                = $::os_service_default,
206   $http_connect_timeout           = $::os_service_default,
207   $http_request_max_retries       = $::os_service_default,
208   $include_service_catalog        = $::os_service_default,
209   $keyfile                        = $::os_service_default,
210   $memcache_pool_conn_get_timeout = $::os_service_default,
211   $memcache_pool_dead_retry       = $::os_service_default,
212   $memcache_pool_maxsize          = $::os_service_default,
213   $memcache_pool_socket_timeout   = $::os_service_default,
214   $memcache_pool_unused_timeout   = $::os_service_default,
215   $memcache_secret_key            = $::os_service_default,
216   $memcache_security_strategy     = $::os_service_default,
217   $memcache_use_advanced_pool     = $::os_service_default,
218   $memcached_servers              = $::os_service_default,
219   $manage_memcache_package        = false,
220   $region_name                    = $::os_service_default,
221   $revocation_cache_time          = $::os_service_default,
222   $token_cache_time               = $::os_service_default,
223 ) {
224
225   keystone::resource::authtoken { 'barometer_config':
226     username                       => $username,
227     password                       => $password,
228     project_name                   => $project_name,
229     auth_url                       => $auth_url,
230     auth_uri                       => $auth_uri,
231     auth_version                   => $auth_version,
232     auth_type                      => $auth_type,
233     auth_section                   => $auth_section,
234     user_domain_name               => $user_domain_name,
235     project_domain_name            => $project_domain_name,
236     insecure                       => $insecure,
237     cache                          => $cache,
238     cafile                         => $cafile,
239     certfile                       => $certfile,
240     check_revocations_for_cached   => $check_revocations_for_cached,
241     delay_auth_decision            => $delay_auth_decision,
242     enforce_token_bind             => $enforce_token_bind,
243     hash_algorithms                => $hash_algorithms,
244     http_connect_timeout           => $http_connect_timeout,
245     http_request_max_retries       => $http_request_max_retries,
246     include_service_catalog        => $include_service_catalog,
247     keyfile                        => $keyfile,
248     memcache_pool_conn_get_timeout => $memcache_pool_conn_get_timeout,
249     memcache_pool_dead_retry       => $memcache_pool_dead_retry,
250     memcache_pool_maxsize          => $memcache_pool_maxsize,
251     memcache_pool_socket_timeout   => $memcache_pool_socket_timeout,
252     memcache_secret_key            => $memcache_secret_key,
253     memcache_security_strategy     => $memcache_security_strategy,
254     memcache_use_advanced_pool     => $memcache_use_advanced_pool,
255     memcache_pool_unused_timeout   => $memcache_pool_unused_timeout,
256     memcached_servers              => $memcached_servers,
257     manage_memcache_package        => $manage_memcache_package,
258     region_name                    => $region_name,
259     revocation_cache_time          => $revocation_cache_time,
260     token_cache_time               => $token_cache_time,
261   }
262 }
263