Remove old authtoken options

Since we are in ocata lets remove all old parameters
to configure the keystone_authtoken section

Change-Id: Ibab5e0489e1070ffed319ad214027fd1b40735a0
This commit is contained in:
Iury Gregory Melo Ferreira 2016-11-06 13:54:53 -03:00
parent 9b0aa85594
commit 8b5b630c3c
8 changed files with 249 additions and 398 deletions

View File

@ -67,33 +67,6 @@
# (Optional) Public URL to use when building the links to the API resources
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS
#
# [*identity_uri*]
# (optional) Complete admin Identity API endpoint.
# Defaults to undef.
#
# [*admin_tenant_name*]
# (optional) The name of the tenant to create in keystone for use by the ironic services
# Defaults to undef.
#
# [*admin_user*]
# (optional) The name of the user to create in keystone for use by the ironic services
# Defaults to undef.
#
# [*admin_password*]
# (optional) The password to set for the ironic admin user in keystone.
# Defaults to undef.
#
# [*auth_uri*]
# (optional) Complete public Identity API endpoint.
# Defaults to undef.
#
# [*memcached_servers*]
# (optinal) a list of memcached server(s) to use for caching. If left
# undefined, tokens will instead be cached in-process.
# Defaults to undef.
#
# [*enable_proxy_headers_parsing*]
# (Optional) Enable paste middleware to handle SSL requests through
# HTTPProxyToWSGI middleware.
@ -110,49 +83,11 @@ class ironic::api (
$neutron_url = 'http://127.0.0.1:9696/',
$public_endpoint = $::os_service_default,
$enable_proxy_headers_parsing = $::os_service_default,
# DEPRECATED PARAMETERS
$identity_uri = undef,
$admin_tenant_name = undef,
$admin_user = undef,
$admin_password = undef,
$auth_uri = undef,
$memcached_servers = undef,
) inherits ironic::params {
include ::ironic::deps
include ::ironic::params
include ::ironic::policy
if $admin_tenant_name {
warning("Parameter 'ironic::api::admin_tenant_name' is deprecated and will be removed in O release. \
Use 'ironic::api::authtoken::project_name' parameter instead.")
}
if $admin_user {
warning("Parameter 'ironic::api::admin_user' is deprecated will be removed in O release. \
Use 'ironic::api::authtoken::username' parameter instead.")
}
if $admin_password {
warning("Parameter 'ironic::api::admin_password' is deprecated and will be removed in O release. \
Use 'ironic::api::authtoken::password' parameter instead.")
}
if $identity_uri {
warning("Parameter 'ironic::api::identity_uri' is deprecated and will be removed in O release. \
Use 'ironic::api::authtoken::auth_url' parameter instead.")
}
if $auth_uri {
warning("Parameter 'ironic::api::auth_uri' is deprecated and will be removed in O release. \
Use 'ironic::api::authtoken::auth_url' parameter instead.")
}
if $memcached_servers {
warning("Parameter 'ironic::api::memcached_servers' is deprecated and will be removed in O release. \
Use 'ironic::api::authtoken::memcached_servers' parameter instead.")
}
include ::ironic::api::authtoken
# Configure ironic.conf

View File

@ -29,166 +29,161 @@
# Defaults to $::os_service_default
#
# [*insecure*]
# (Optional) If true, explicitly allow TLS without checking server cert
# against any certificate authorities. WARNING: not recommended. Use with
# caution.
# Defaults to $:os_service_default
# (Optional) If true, explicitly allow TLS without checking server cert
# against any certificate authorities. WARNING: not recommended. Use with
# caution.
# Defaults to $:os_service_default
#
# [*auth_section*]
# (Optional) Config Section from which to load plugin specific options
# Defaults to $::os_service_default.
# (Optional) Config Section from which to load plugin specific options
# Defaults to $::os_service_default.
#
# [*auth_type*]
# (Optional) Authentication type to load
# Defaults to 'password'.
# (Optional) Authentication type to load
# Defaults to 'password'.
#
# [*auth_uri*]
# (Optional) Complete public Identity API endpoint.
# Defaults to 'http://127.0.0.1:5000'.
# (Optional) Complete public Identity API endpoint.
# Defaults to 'http://127.0.0.1:5000'.
#
# [*auth_version*]
# (Optional) API version of the admin Identity API endpoint.
# Defaults to $::os_service_default.
# (Optional) API version of the admin Identity API endpoint.
# Defaults to $::os_service_default.
#
# [*cache*]
# (Optional) Env key for the swift cache.
# Defaults to $::os_service_default.
# (Optional) Env key for the swift cache.
# Defaults to $::os_service_default.
#
# [*cafile*]
# (Optional) A PEM encoded Certificate Authority to use when verifying HTTPs
# connections.
# Defaults to $::os_service_default.
# (Optional) A PEM encoded Certificate Authority to use when verifying HTTPs
# connections.
# Defaults to $::os_service_default.
#
# [*certfile*]
# (Optional) Required if identity server requires client certificate
# Defaults to $::os_service_default.
# (Optional) Required if identity server requires client certificate
# Defaults to $::os_service_default.
#
# [*check_revocations_for_cached*]
# (Optional) If true, the revocation list will be checked for cached tokens.
# This requires that PKI tokens are configured on the identity server.
# boolean value.
# Defaults to $::os_service_default.
# (Optional) If true, the revocation list will be checked for cached tokens.
# This requires that PKI tokens are configured on the identity server.
# boolean value.
# Defaults to $::os_service_default.
#
# [*delay_auth_decision*]
# (Optional) Do not handle authorization requests within the middleware, but
# delegate the authorization decision to downstream WSGI components. Boolean
# value
# Defaults to $::os_service_default.
# (Optional) Do not handle authorization requests within the middleware, but
# delegate the authorization decision to downstream WSGI components. Boolean
# value
# Defaults to $::os_service_default.
#
# [*enforce_token_bind*]
# (Optional) Used to control the use and type of token binding. Can be set
# to: "disabled" to not check token binding. "permissive" (default) to
# validate binding information if the bind type is of a form known to the
# server and ignore it if not. "strict" like "permissive" but if the bind
# type is unknown the token will be rejected. "required" any form of token
# binding is needed to be allowed. Finally the name of a binding method that
# must be present in tokens. String value.
# Defaults to $::os_service_default.
# (Optional) Used to control the use and type of token binding. Can be set
# to: "disabled" to not check token binding. "permissive" (default) to
# validate binding information if the bind type is of a form known to the
# server and ignore it if not. "strict" like "permissive" but if the bind
# type is unknown the token will be rejected. "required" any form of token
# binding is needed to be allowed. Finally the name of a binding method that
# must be present in tokens. String value.
# Defaults to $::os_service_default.
#
# [*hash_algorithms*]
# (Optional) Hash algorithms to use for hashing PKI tokens. This may be a
# single algorithm or multiple. The algorithms are those supported by Python
# standard hashlib.new(). The hashes will be tried in the order given, so put
# the preferred one first for performance. The result of the first hash will
# be stored in the cache. This will typically be set to multiple values only
# while migrating from a less secure algorithm to a more secure one. Once all
# the old tokens are expired this option should be set to a single value for
# better performance. List value.
# Defaults to $::os_service_default.
# (Optional) Hash algorithms to use for hashing PKI tokens. This may be a
# single algorithm or multiple. The algorithms are those supported by Python
# standard hashlib.new(). The hashes will be tried in the order given, so put
# the preferred one first for performance. The result of the first hash will
# be stored in the cache. This will typically be set to multiple values only
# while migrating from a less secure algorithm to a more secure one. Once all
# the old tokens are expired this option should be set to a single value for
# better performance. List value.
# Defaults to $::os_service_default.
#
# [*http_connect_timeout*]
# (Optional) Request timeout value for communicating with Identity API
# server.
# Defaults to $::os_service_default.
# (Optional) Request timeout value for communicating with Identity API
# server.
# Defaults to $::os_service_default.
#
# [*http_request_max_retries*]
# (Optional) How many times are we trying to reconnect when communicating
# with Identity API Server. Integer value
# Defaults to $::os_service_default.
# (Optional) How many times are we trying to reconnect when communicating
# with Identity API Server. Integer value
# Defaults to $::os_service_default.
#
# [*include_service_catalog*]
# (Optional) Indicate whether to set the X-Service-Catalog header. If False,
# middleware will not ask for service catalog on token validation and will
# not
# set the X-Service-Catalog header. Boolean value.
# Defaults to $::os_service_default.
# (Optional) Indicate whether to set the X-Service-Catalog header. If False,
# middleware will not ask for service catalog on token validation and will
# not set the X-Service-Catalog header. Boolean value.
# Defaults to $::os_service_default.
#
# [*keyfile*]
# (Optional) Required if identity server requires client certificate
# Defaults to $::os_service_default.
# (Optional) Required if identity server requires client certificate
# Defaults to $::os_service_default.
#
# [*memcache_pool_conn_get_timeout*]
# (Optional) Number of seconds that an operation will wait to get a memcached
# client connection from the pool. Integer value
# Defaults to $::os_service_default.
# (Optional) Number of seconds that an operation will wait to get a memcached
# client connection from the pool. Integer value
# Defaults to $::os_service_default.
#
# [*memcache_pool_dead_retry*]
# (Optional) Number of seconds memcached server is considered dead before it
# is tried again. Integer value
# Defaults to $::os_service_default.
# (Optional) Number of seconds memcached server is considered dead before it
# is tried again. Integer value
# Defaults to $::os_service_default.
#
# [*memcache_pool_maxsize*]
# (Optional) Maximum total number of open connections to every memcached
# server. Integer value
# Defaults to $::os_service_default.
# (Optional) Maximum total number of open connections to every memcached
# server. Integer value
# Defaults to $::os_service_default.
#
# [*memcache_pool_socket_timeout*]
# (Optional) Number of seconds a connection to memcached is held unused in
# the
# pool before it is closed. Integer value
# Defaults to $::os_service_default.
# (Optional) Number of seconds a connection to memcached is held unused in
# the pool before it is closed. Integer value
# Defaults to $::os_service_default.
#
# [*memcache_pool_unused_timeout*]
# (Optional) Number of seconds a connection to memcached is held unused in
# the
# pool before it is closed. Integer value
# Defaults to $::os_service_default.
# (Optional) Number of seconds a connection to memcached is held unused in
# the pool before it is closed. Integer value
# Defaults to $::os_service_default.
#
# [*memcache_secret_key*]
# (Optional, mandatory if memcache_security_strategy is defined) This string
# is used for key derivation.
# Defaults to $::os_service_default.
# (Optional, mandatory if memcache_security_strategy is defined) This string
# is used for key derivation.
# Defaults to $::os_service_default.
#
# [*memcache_security_strategy*]
# (Optional) If defined, indicate whether token data should be authenticated
# or
# authenticated and encrypted. If MAC, token data is authenticated (with
# HMAC)
# in the cache. If ENCRYPT, token data is encrypted and authenticated in the
# cache. If the value is not one of these options or empty, auth_token will
# raise an exception on initialization.
# Defaults to $::os_service_default.
# (Optional) If defined, indicate whether token data should be authenticated
# or authenticated and encrypted. If MAC, token data is authenticated (with
# HMAC) in the cache. If ENCRYPT, token data is encrypted and authenticated in the
# cache. If the value is not one of these options or empty, auth_token will
# raise an exception on initialization.
# Defaults to $::os_service_default.
#
# [*memcache_use_advanced_pool*]
# (Optional) Use the advanced (eventlet safe) memcached client pool. The
# advanced pool will only work under python 2.x Boolean value
# Defaults to $::os_service_default.
# (Optional) Use the advanced (eventlet safe) memcached client pool. The
# advanced pool will only work under python 2.x Boolean value
# Defaults to $::os_service_default.
#
# [*memcached_servers*]
# (Optional) Optionally specify a list of memcached server(s) to use for
# caching. If left undefined, tokens will instead be cached in-process.
# Defaults to $::os_service_default.
# (Optional) Optionally specify a list of memcached server(s) to use for
# caching. If left undefined, tokens will instead be cached in-process.
# Defaults to $::os_service_default.
#
# [*region_name*]
# (Optional) The region in which the identity server can be found.
# Defaults to $::os_service_default.
# (Optional) The region in which the identity server can be found.
# Defaults to $::os_service_default.
#
# [*revocation_cache_time*]
# (Optional) Determines the frequency at which the list of revoked tokens is
# retrieved from the Identity service (in seconds). A high number of
# revocation events combined with a low cache duration may significantly
# reduce performance. Only valid for PKI tokens. Integer value
# Defaults to $::os_service_default.
# (Optional) Determines the frequency at which the list of revoked tokens is
# retrieved from the Identity service (in seconds). A high number of
# revocation events combined with a low cache duration may significantly
# reduce performance. Only valid for PKI tokens. Integer value
# Defaults to $::os_service_default.
#
# [*signing_dir*]
# (Optional) Directory used to cache files related to PKI tokens.
# Defaults to $::os_service_default.
# (Optional) Directory used to cache files related to PKI tokens.
# Defaults to $::os_service_default.
#
# [*token_cache_time*]
# (Optional) In order to prevent excessive effort spent validating tokens,
# the middleware caches previously-seen tokens for a configurable duration
# (in seconds). Set to -1 to disable caching completely. Integer value
# Defaults to $::os_service_default.
# (Optional) In order to prevent excessive effort spent validating tokens,
# the middleware caches previously-seen tokens for a configurable duration
# (in seconds). Set to -1 to disable caching completely. Integer value
# Defaults to $::os_service_default.
#
class ironic::api::authtoken(
$username = 'ironic',
@ -230,23 +225,16 @@ class ironic::api::authtoken(
include ::ironic::deps
if is_service_default($password) and ! $::ironic::api::admin_password {
if is_service_default($password) {
fail('Please set password for Ironic API service user')
}
$username_real = pick($::ironic::api::admin_user, $username)
$password_real = pick($::ironic::api::admin_password, $password)
$project_name_real = pick($::ironic::api::admin_tenant_name, $project_name)
$auth_uri_real = pick($::ironic::api::auth_uri, $auth_uri)
$auth_url_real = pick($::ironic::api::identity_uri, $auth_url)
$memcached_servers_real = pick($::ironic::api::memcached_servers, $memcached_servers)
keystone::resource::authtoken { 'ironic_config':
username => $username_real,
password => $password_real,
project_name => $project_name_real,
auth_url => $auth_url_real,
auth_uri => $auth_uri_real,
username => $username,
password => $password,
project_name => $project_name,
auth_url => $auth_url,
auth_uri => $auth_uri,
auth_version => $auth_version,
auth_type => $auth_type,
auth_section => $auth_section,
@ -272,11 +260,10 @@ class ironic::api::authtoken(
memcache_security_strategy => $memcache_security_strategy,
memcache_use_advanced_pool => $memcache_use_advanced_pool,
memcache_pool_unused_timeout => $memcache_pool_unused_timeout,
memcached_servers => $memcached_servers_real,
memcached_servers => $memcached_servers,
region_name => $region_name,
revocation_cache_time => $revocation_cache_time,
signing_dir => $signing_dir,
token_cache_time => $token_cache_time,
}
}

View File

@ -163,28 +163,6 @@
# (optional) Whether to store the boot mode (BIOS or UEFI).
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS
#
# [*identity_uri*]
# (optional) Complete admin Identity API endpoint.
# Defaults to undef.
#
# [*admin_tenant_name*]
# (optional) The name of the tenant to create in keystone for use by the ironic services
# Defaults to undef.
#
# [*admin_user*]
# (optional) The name of the user to create in keystone for use by the ironic services
# Defaults to undef.
#
# [*admin_password*]
# (optional) The password to set for the ironic admin user in keystone.
# Defaults to undef.
#
# [*auth_uri*]
# (optional) Complete public Identity API endpoint.
# Defaults to undef.
#
class ironic::inspector (
$package_ensure = 'present',
$enabled = true,
@ -222,12 +200,6 @@ class ironic::inspector (
$detect_boot_mode = $::os_service_default,
$tftp_root = '/tftpboot',
$http_root = '/httpboot',
# DEPRECATED PARAMETERS
$identity_uri = undef,
$admin_tenant_name = undef,
$admin_user = undef,
$admin_password = undef,
$auth_uri = undef,
) {
include ::ironic::deps
@ -236,31 +208,6 @@ class ironic::inspector (
include ::ironic::inspector::logging
include ::ironic::inspector::db
if $admin_tenant_name {
warning("Parameter 'ironic::inspector::admin_tenant_name' is deprecated and will be removed in O release. \
Use 'ironic::inspector::authtoken::project_name' parameter instead.")
}
if $admin_user {
warning("Parameter 'ironic::inspector::admin_user' is deprecated will be removed in O release. \
Use 'ironic::inspector::authtoken::username' parameter instead.")
}
if $admin_password {
warning("Parameter 'ironic::inspector::admin_password' is deprecated and will be removed in O release. \
Use 'ironic::inspector::authtoken::password' parameter instead.")
}
if $identity_uri {
warning("Parameter 'ironic::inspector::identity_uri' is deprecated and will be removed in O release. \
Use 'ironic::inspector::authtoken::auth_url' parameter instead.")
}
if $auth_uri {
warning("Parameter 'ironic::inspector::auth_uri' is deprecated and will be removed in O release. \
Use 'ironic::inspector::authtoken::auth_uri' parameter instead.")
}
if $auth_strategy == 'keystone' {
include ::ironic::inspector::authtoken
}

View File

@ -29,166 +29,161 @@
# Defaults to $::os_service_default
#
# [*insecure*]
# (Optional) If true, explicitly allow TLS without checking server cert
# against any certificate authorities. WARNING: not recommended. Use with
# caution.
# Defaults to $:os_service_default
# (Optional) If true, explicitly allow TLS without checking server cert
# against any certificate authorities. WARNING: not recommended. Use with
# caution.
# Defaults to $:os_service_default
#
# [*auth_section*]
# (Optional) Config Section from which to load plugin specific options
# Defaults to $::os_service_default.
# (Optional) Config Section from which to load plugin specific options
# Defaults to $::os_service_default.
#
# [*auth_type*]
# (Optional) Authentication type to load
# Defaults to 'password'.
# (Optional) Authentication type to load
# Defaults to 'password'.
#
# [*auth_uri*]
# (Optional) Complete public Identity API endpoint.
# Defaults to 'http://127.0.0.1:5000'.
# (Optional) Complete public Identity API endpoint.
# Defaults to 'http://127.0.0.1:5000'.
#
# [*auth_version*]
# (Optional) API version of the admin Identity API endpoint.
# Defaults to $::os_service_default.
# (Optional) API version of the admin Identity API endpoint.
# Defaults to $::os_service_default.
#
# [*cache*]
# (Optional) Env key for the swift cache.
# Defaults to $::os_service_default.
# (Optional) Env key for the swift cache.
# Defaults to $::os_service_default.
#
# [*cafile*]
# (Optional) A PEM encoded Certificate Authority to use when verifying HTTPs
# connections.
# Defaults to $::os_service_default.
# (Optional) A PEM encoded Certificate Authority to use when verifying HTTPs
# connections.
# Defaults to $::os_service_default.
#
# [*certfile*]
# (Optional) Required if identity server requires client certificate
# Defaults to $::os_service_default.
# (Optional) Required if identity server requires client certificate
# Defaults to $::os_service_default.
#
# [*check_revocations_for_cached*]
# (Optional) If true, the revocation list will be checked for cached tokens.
# This requires that PKI tokens are configured on the identity server.
# boolean value.
# Defaults to $::os_service_default.
# (Optional) If true, the revocation list will be checked for cached tokens.
# This requires that PKI tokens are configured on the identity server.
# boolean value.
# Defaults to $::os_service_default.
#
# [*delay_auth_decision*]
# (Optional) Do not handle authorization requests within the middleware, but
# delegate the authorization decision to downstream WSGI components. Boolean
# value
# Defaults to $::os_service_default.
# (Optional) Do not handle authorization requests within the middleware, but
# delegate the authorization decision to downstream WSGI components. Boolean
# value
# Defaults to $::os_service_default.
#
# [*enforce_token_bind*]
# (Optional) Used to control the use and type of token binding. Can be set
# to: "disabled" to not check token binding. "permissive" (default) to
# validate binding information if the bind type is of a form known to the
# server and ignore it if not. "strict" like "permissive" but if the bind
# type is unknown the token will be rejected. "required" any form of token
# binding is needed to be allowed. Finally the name of a binding method that
# must be present in tokens. String value.
# Defaults to $::os_service_default.
# (Optional) Used to control the use and type of token binding. Can be set
# to: "disabled" to not check token binding. "permissive" (default) to
# validate binding information if the bind type is of a form known to the
# server and ignore it if not. "strict" like "permissive" but if the bind
# type is unknown the token will be rejected. "required" any form of token
# binding is needed to be allowed. Finally the name of a binding method that
# must be present in tokens. String value.
# Defaults to $::os_service_default.
#
# [*hash_algorithms*]
# (Optional) Hash algorithms to use for hashing PKI tokens. This may be a
# single algorithm or multiple. The algorithms are those supported by Python
# standard hashlib.new(). The hashes will be tried in the order given, so put
# the preferred one first for performance. The result of the first hash will
# be stored in the cache. This will typically be set to multiple values only
# while migrating from a less secure algorithm to a more secure one. Once all
# the old tokens are expired this option should be set to a single value for
# better performance. List value.
# Defaults to $::os_service_default.
# (Optional) Hash algorithms to use for hashing PKI tokens. This may be a
# single algorithm or multiple. The algorithms are those supported by Python
# standard hashlib.new(). The hashes will be tried in the order given, so put
# the preferred one first for performance. The result of the first hash will
# be stored in the cache. This will typically be set to multiple values only
# while migrating from a less secure algorithm to a more secure one. Once all
# the old tokens are expired this option should be set to a single value for
# better performance. List value.
# Defaults to $::os_service_default.
#
# [*http_connect_timeout*]
# (Optional) Request timeout value for communicating with Identity API
# server.
# Defaults to $::os_service_default.
# (Optional) Request timeout value for communicating with Identity API
# server.
# Defaults to $::os_service_default.
#
# [*http_request_max_retries*]
# (Optional) How many times are we trying to reconnect when communicating
# with Identity API Server. Integer value
# Defaults to $::os_service_default.
# (Optional) How many times are we trying to reconnect when communicating
# with Identity API Server. Integer value
# Defaults to $::os_service_default.
#
# [*include_service_catalog*]
# (Optional) Indicate whether to set the X-Service-Catalog header. If False,
# middleware will not ask for service catalog on token validation and will
# not
# set the X-Service-Catalog header. Boolean value.
# Defaults to $::os_service_default.
# (Optional) Indicate whether to set the X-Service-Catalog header. If False,
# middleware will not ask for service catalog on token validation and will
# not set the X-Service-Catalog header. Boolean value.
# Defaults to $::os_service_default.
#
# [*keyfile*]
# (Optional) Required if identity server requires client certificate
# Defaults to $::os_service_default.
# (Optional) Required if identity server requires client certificate
# Defaults to $::os_service_default.
#
# [*memcache_pool_conn_get_timeout*]
# (Optional) Number of seconds that an operation will wait to get a memcached
# client connection from the pool. Integer value
# Defaults to $::os_service_default.
# (Optional) Number of seconds that an operation will wait to get a memcached
# client connection from the pool. Integer value
# Defaults to $::os_service_default.
#
# [*memcache_pool_dead_retry*]
# (Optional) Number of seconds memcached server is considered dead before it
# is tried again. Integer value
# Defaults to $::os_service_default.
# (Optional) Number of seconds memcached server is considered dead before it
# is tried again. Integer value
# Defaults to $::os_service_default.
#
# [*memcache_pool_maxsize*]
# (Optional) Maximum total number of open connections to every memcached
# server. Integer value
# Defaults to $::os_service_default.
# (Optional) Maximum total number of open connections to every memcached
# server. Integer value
# Defaults to $::os_service_default.
#
# [*memcache_pool_socket_timeout*]
# (Optional) Number of seconds a connection to memcached is held unused in
# the
# pool before it is closed. Integer value
# Defaults to $::os_service_default.
# (Optional) Number of seconds a connection to memcached is held unused in
# the pool before it is closed. Integer value
# Defaults to $::os_service_default.
#
# [*memcache_pool_unused_timeout*]
# (Optional) Number of seconds a connection to memcached is held unused in
# the
# pool before it is closed. Integer value
# Defaults to $::os_service_default.
# (Optional) Number of seconds a connection to memcached is held unused in
# the pool before it is closed. Integer value
# Defaults to $::os_service_default.
#
# [*memcache_secret_key*]
# (Optional, mandatory if memcache_security_strategy is defined) This string
# is used for key derivation.
# Defaults to $::os_service_default.
# (Optional, mandatory if memcache_security_strategy is defined) This string
# is used for key derivation.
# Defaults to $::os_service_default.
#
# [*memcache_security_strategy*]
# (Optional) If defined, indicate whether token data should be authenticated
# or
# authenticated and encrypted. If MAC, token data is authenticated (with
# HMAC)
# in the cache. If ENCRYPT, token data is encrypted and authenticated in the
# cache. If the value is not one of these options or empty, auth_token will
# raise an exception on initialization.
# Defaults to $::os_service_default.
# (Optional) If defined, indicate whether token data should be authenticated
# or authenticated and encrypted. If MAC, token data is authenticated (with
# HMAC) in the cache. If ENCRYPT, token data is encrypted and authenticated in the
# cache. If the value is not one of these options or empty, auth_token will
# raise an exception on initialization.
# Defaults to $::os_service_default.
#
# [*memcache_use_advanced_pool*]
# (Optional) Use the advanced (eventlet safe) memcached client pool. The
# advanced pool will only work under python 2.x Boolean value
# Defaults to $::os_service_default.
# (Optional) Use the advanced (eventlet safe) memcached client pool. The
# advanced pool will only work under python 2.x Boolean value
# Defaults to $::os_service_default.
#
# [*memcached_servers*]
# (Optional) Optionally specify a list of memcached server(s) to use for
# caching. If left undefined, tokens will instead be cached in-process.
# Defaults to $::os_service_default.
# (Optional) Optionally specify a list of memcached server(s) to use for
# caching. If left undefined, tokens will instead be cached in-process.
# Defaults to $::os_service_default.
#
# [*region_name*]
# (Optional) The region in which the identity server can be found.
# Defaults to $::os_service_default.
# (Optional) The region in which the identity server can be found.
# Defaults to $::os_service_default.
#
# [*revocation_cache_time*]
# (Optional) Determines the frequency at which the list of revoked tokens is
# retrieved from the Identity service (in seconds). A high number of
# revocation events combined with a low cache duration may significantly
# reduce performance. Only valid for PKI tokens. Integer value
# Defaults to $::os_service_default.
# (Optional) Determines the frequency at which the list of revoked tokens is
# retrieved from the Identity service (in seconds). A high number of
# revocation events combined with a low cache duration may significantly
# reduce performance. Only valid for PKI tokens. Integer value
# Defaults to $::os_service_default.
#
# [*signing_dir*]
# (Optional) Directory used to cache files related to PKI tokens.
# Defaults to $::os_service_default.
# (Optional) Directory used to cache files related to PKI tokens.
# Defaults to $::os_service_default.
#
# [*token_cache_time*]
# (Optional) In order to prevent excessive effort spent validating tokens,
# the middleware caches previously-seen tokens for a configurable duration
# (in seconds). Set to -1 to disable caching completely. Integer value
# Defaults to $::os_service_default.
# (Optional) In order to prevent excessive effort spent validating tokens,
# the middleware caches previously-seen tokens for a configurable duration
# (in seconds). Set to -1 to disable caching completely. Integer value
# Defaults to $::os_service_default.
#
class ironic::inspector::authtoken(
$username = 'ironic',
@ -230,23 +225,16 @@ class ironic::inspector::authtoken(
include ::ironic::deps
if is_service_default($password) and ! $::ironic::inspector::admin_password {
if is_service_default($password) {
fail('Please set password for Ironic Inspector service user')
}
$username_real = pick($::ironic::inspector::admin_user, $username)
$password_real = pick($::ironic::inspector::admin_password, $password)
$project_name_real = pick($::ironic::inspector::admin_tenant_name, $project_name)
$auth_uri_real = pick($::ironic::inspector::auth_uri, $auth_uri)
$auth_url_real = pick($::ironic::inspector::identity_uri, $auth_url)
$memcached_servers_real = pick($::ironic::inspector::memcached_servers, $memcached_servers)
keystone::resource::authtoken { 'ironic_inspector_config':
username => $username_real,
password => $password_real,
project_name => $project_name_real,
auth_url => $auth_url_real,
auth_uri => $auth_uri_real,
username => $username,
password => $password,
project_name => $project_name,
auth_url => $auth_url,
auth_uri => $auth_uri,
auth_version => $auth_version,
auth_type => $auth_type,
auth_section => $auth_section,
@ -272,11 +260,10 @@ class ironic::inspector::authtoken(
memcache_security_strategy => $memcache_security_strategy,
memcache_use_advanced_pool => $memcache_use_advanced_pool,
memcache_pool_unused_timeout => $memcache_pool_unused_timeout,
memcached_servers => $memcached_servers_real,
memcached_servers => $memcached_servers,
region_name => $region_name,
revocation_cache_time => $revocation_cache_time,
signing_dir => $signing_dir,
token_cache_time => $token_cache_time,
}
}

View File

@ -0,0 +1,13 @@
---
other:
- removed deprecated ironic::api::admin_user
- removed deprecated ironic::api::admin_password
- removed deprecated ironic::api::admin_tenant_name
- removed deprecated ironic::api::auth_uri
- removed deprecated ironic::api::identity_uri
- removed deprecated ironic::api::memcached_servers
- removed deprecated ironic::inspector::admin_user
- removed deprecated ironic::inspector::admin_password
- removed deprecated ironic::inspector::admin_tenant_name
- removed deprecated ironic::inspector::auth_uri
- removed deprecated ironic::inspector::identity_uri

View File

@ -49,8 +49,10 @@ describe 'basic ironic' do
class { '::ironic::conductor':
enabled_drivers => ['pxe_ssh'],
}
class { '::ironic::api::authtoken':
password => 'a_big_secret',
}
class { '::ironic::api':
admin_password => 'a_big_secret',
service_name => 'httpd',
}
include ::apache
@ -68,10 +70,10 @@ describe 'basic ironic' do
class { '::ironic::inspector::db::mysql':
password => 'a_big_secret',
}
class { '::ironic::inspector::authtoken':
password => 'a_big_secret',
}
class { '::ironic::inspector':
auth_uri => "https://${::fqdn}:5000/v2.0",
identity_uri => "https://${::fqdn}:35357",
admin_password => 'a_big_secret',
ironic_password => 'a_big_secret',
ironic_auth_url => "https://${::fqdn}:5000/v2.0",
dnsmasq_interface => 'eth0',

View File

@ -21,6 +21,11 @@
require 'spec_helper'
describe 'ironic::api' do
let :pre_condition do
"class { '::ironic::api::authtoken':
password => 'password',
}"
end
let :params do
{ :package_ensure => 'present',
@ -28,11 +33,6 @@ describe 'ironic::api' do
:port => '6385',
:max_limit => '1000',
:host_ip => '0.0.0.0',
:admin_user => 'ironic',
:admin_password => 'password',
:admin_tenant_name => 'admin_tenant',
:auth_uri => 'http://127.0.0.1:5000/v2.0',
:identity_uri => 'http://127.0.0.1:35357/v2.0',
}
end
@ -69,13 +69,7 @@ describe 'ironic::api' do
is_expected.to contain_ironic_config('api/max_limit').with_value(p[:max_limit])
is_expected.to contain_ironic_config('api/api_workers').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('api/public_endpoint').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('keystone_authtoken/password').with_value(p[:admin_password])
is_expected.to contain_ironic_config('keystone_authtoken/username').with_value(p[:admin_user])
is_expected.to contain_ironic_config('keystone_authtoken/auth_uri').with_value(p[:auth_uri])
is_expected.to contain_ironic_config('keystone_authtoken/auth_url').with_value(p[:identity_uri])
is_expected.to contain_ironic_config('keystone_authtoken/memcached_servers').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('neutron/url').with_value('http://127.0.0.1:9696/')
is_expected.to contain_ironic_config('keystone_authtoken/project_name').with_value(p[:admin_tenant_name])
is_expected.to contain_ironic_config('oslo_middleware/enable_proxy_headers_parsing').with_value('<SERVICE DEFAULT>')
end
@ -86,11 +80,7 @@ describe 'ironic::api' do
:host_ip => '127.0.0.1',
:max_limit => '10',
:workers => '8',
:auth_uri => 'https://1.2.3.4:5000/',
:identity_uri => 'https://1.2.3.4:35357/',
:public_endpoint => 'https://1.2.3.4:6385/',
:memcached_servers => '1.1.1.1:11211',
:admin_tenant_name => 'ironic_tenant',
)
end
it 'should replace default parameter with new value' do
@ -99,10 +89,6 @@ describe 'ironic::api' do
is_expected.to contain_ironic_config('api/max_limit').with_value(p[:max_limit])
is_expected.to contain_ironic_config('api/api_workers').with_value(p[:workers])
is_expected.to contain_ironic_config('api/public_endpoint').with_value(p[:public_endpoint])
is_expected.to contain_ironic_config('keystone_authtoken/auth_uri').with_value('https://1.2.3.4:5000/')
is_expected.to contain_ironic_config('keystone_authtoken/auth_url').with_value('https://1.2.3.4:35357/')
is_expected.to contain_ironic_config('keystone_authtoken/project_name').with_value('ironic_tenant')
is_expected.to contain_ironic_config('keystone_authtoken/memcached_servers').with_value('1.1.1.1:11211')
end
end
@ -120,7 +106,10 @@ describe 'ironic::api' do
end
let :pre_condition do
"include ::apache"
"class { '::ironic::api::authtoken':
password => 'password',
}
include ::apache"
end
it 'configures ironic-api service with Apache' do
@ -139,7 +128,10 @@ describe 'ironic::api' do
end
let :pre_condition do
"include ::apache"
"class { '::ironic::api::authtoken':
password => 'password',
}
include ::apache"
end
it_raises 'a Puppet::Error', /Invalid service_name/

View File

@ -19,6 +19,11 @@
require 'spec_helper'
describe 'ironic::inspector' do
let :pre_condition do
"class { 'ironic::inspector::authtoken':
password => 'password',
}"
end
let :params do
{ :package_ensure => 'present',
@ -26,11 +31,6 @@ describe 'ironic::inspector' do
:pxe_transfer_protocol => 'tftp',
:enable_uefi => false,
:auth_strategy => 'keystone',
:auth_uri => 'http://127.0.0.1:5000/v2.0',
:admin_user => 'ironic',
:admin_password => 'password',
:admin_tenant_name => 'services',
:identity_uri => 'http://127.0.0.1:35357/v2.0',
:dnsmasq_interface => 'br-ctlplane',
:ramdisk_logs_dir => '/var/log/ironic-inspector/ramdisk/',
:enable_setting_ipmi_credentials => false,
@ -94,12 +94,6 @@ describe 'ironic::inspector' do
is_expected.to contain_ironic_inspector_config('DEFAULT/listen_address').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_inspector_config('DEFAULT/auth_strategy').with_value(p[:auth_strategy])
is_expected.to contain_ironic_inspector_config('capabilities/boot_mode').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_inspector_config('keystone_authtoken/auth_type').with_value('password')
is_expected.to contain_ironic_inspector_config('keystone_authtoken/auth_uri').with_value(p[:auth_uri])
is_expected.to contain_ironic_inspector_config('keystone_authtoken/auth_url').with_value(p[:identity_uri])
is_expected.to contain_ironic_inspector_config('keystone_authtoken/username').with_value(p[:admin_user])
is_expected.to contain_ironic_inspector_config('keystone_authtoken/password').with_value(p[:admin_password])
is_expected.to contain_ironic_inspector_config('keystone_authtoken/project_name').with_value(p[:admin_tenant_name])
is_expected.to contain_ironic_inspector_config('firewall/dnsmasq_interface').with_value(p[:dnsmasq_interface])
is_expected.to contain_ironic_inspector_config('processing/ramdisk_logs_dir').with_value(p[:ramdisk_logs_dir])
is_expected.to contain_ironic_inspector_config('processing/enable_setting_ipmi_credentials').with_value(p[:enable_setting_ipmi_credentials])
@ -150,9 +144,6 @@ describe 'ironic::inspector' do
params.merge!(
:debug => true,
:listen_address => '127.0.0.1',
:auth_uri => 'http://192.168.0.1:5000/v2.0',
:identity_uri => 'http://192.168.0.1:35357',
:admin_password => 'password',
:ironic_password => 'password',
:ironic_auth_url => 'http://192.168.0.1:5000/v2.0',
:swift_password => 'password',
@ -171,9 +162,6 @@ describe 'ironic::inspector' do
is_expected.to contain_ironic_inspector_config('DEFAULT/listen_address').with_value(p[:listen_address])
is_expected.to contain_ironic_inspector_config('DEFAULT/debug').with_value(p[:debug])
is_expected.to contain_ironic_inspector_config('capabilities/boot_mode').with_value(p[:detect_boot_mode])
is_expected.to contain_ironic_inspector_config('keystone_authtoken/auth_uri').with_value(p[:auth_uri])
is_expected.to contain_ironic_inspector_config('keystone_authtoken/auth_url').with_value(p[:identity_uri])
is_expected.to contain_ironic_inspector_config('keystone_authtoken/password').with_value(p[:admin_password])
is_expected.to contain_ironic_inspector_config('ironic/password').with_value(p[:ironic_password])
is_expected.to contain_ironic_inspector_config('ironic/auth_url').with_value(p[:ironic_auth_url])
is_expected.to contain_ironic_inspector_config('swift/password').with_value(p[:swift_password])