authtoken.pp 11 KB

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