Move Glance to new authtoken scheme
Use glance::<service>::authtoken to configure keystone_authtoken section in glance configs, with all parameters required to configure keystonemiddleware. Also changed auth_type to auth_strategy, because auth_type is related to keystone authentication. Change-Id: I722a1e41b2cee0b3040c37f07adfd13c33edaa5c Closes-bug: #1604463
This commit is contained in:
parent
804afb9c3e
commit
1e09e553ed
@ -18,9 +18,9 @@ class Puppet::Provider::Glance < Puppet::Provider::Openstack
|
||||
end
|
||||
|
||||
def self.glance_request(service, action, error, properties=nil)
|
||||
@credentials.username = glance_credentials['admin_user']
|
||||
@credentials.password = glance_credentials['admin_password']
|
||||
@credentials.project_name = glance_credentials['admin_tenant_name']
|
||||
@credentials.username = glance_credentials['username']
|
||||
@credentials.password = glance_credentials['password']
|
||||
@credentials.project_name = glance_credentials['project_name']
|
||||
@credentials.auth_url = auth_endpoint
|
||||
raise error unless @credentials.set?
|
||||
Puppet::Provider::Openstack.request(service, action, properties, @credentials)
|
||||
@ -35,18 +35,18 @@ class Puppet::Provider::Glance < Puppet::Provider::Openstack
|
||||
glance_file['keystone_authtoken']['auth_host'] and
|
||||
glance_file['keystone_authtoken']['auth_port'] and
|
||||
glance_file['keystone_authtoken']['auth_protocol'] and
|
||||
glance_file['keystone_authtoken']['admin_tenant_name'] and
|
||||
glance_file['keystone_authtoken']['admin_user'] and
|
||||
glance_file['keystone_authtoken']['admin_password'] and
|
||||
glance_file['keystone_authtoken']['project_name'] and
|
||||
glance_file['keystone_authtoken']['username'] and
|
||||
glance_file['keystone_authtoken']['password'] and
|
||||
glance_file['glance_store']['os_region_name']
|
||||
|
||||
g = {}
|
||||
g['auth_host'] = glance_file['keystone_authtoken']['auth_host'].strip
|
||||
g['auth_port'] = glance_file['keystone_authtoken']['auth_port'].strip
|
||||
g['auth_protocol'] = glance_file['keystone_authtoken']['auth_protocol'].strip
|
||||
g['admin_tenant_name'] = glance_file['keystone_authtoken']['admin_tenant_name'].strip
|
||||
g['admin_user'] = glance_file['keystone_authtoken']['admin_user'].strip
|
||||
g['admin_password'] = glance_file['keystone_authtoken']['admin_password'].strip
|
||||
g['project_name'] = glance_file['keystone_authtoken']['project_name'].strip
|
||||
g['username'] = glance_file['keystone_authtoken']['username'].strip
|
||||
g['password'] = glance_file['keystone_authtoken']['password'].strip
|
||||
g['os_region_name'] = glance_file['glance_store']['os_region_name'].strip
|
||||
|
||||
# auth_admin_prefix not required to be set.
|
||||
@ -54,17 +54,17 @@ class Puppet::Provider::Glance < Puppet::Provider::Openstack
|
||||
|
||||
return g
|
||||
elsif glance_file and glance_file['keystone_authtoken'] and
|
||||
glance_file['keystone_authtoken']['identity_uri'] and
|
||||
glance_file['keystone_authtoken']['admin_tenant_name'] and
|
||||
glance_file['keystone_authtoken']['admin_user'] and
|
||||
glance_file['keystone_authtoken']['admin_password'] and
|
||||
glance_file['keystone_authtoken']['auth_url'] and
|
||||
glance_file['keystone_authtoken']['project_name'] and
|
||||
glance_file['keystone_authtoken']['username'] and
|
||||
glance_file['keystone_authtoken']['password'] and
|
||||
glance_file['glance_store']['os_region_name']
|
||||
|
||||
g = {}
|
||||
g['identity_uri'] = glance_file['keystone_authtoken']['identity_uri'].strip
|
||||
g['admin_tenant_name'] = glance_file['keystone_authtoken']['admin_tenant_name'].strip
|
||||
g['admin_user'] = glance_file['keystone_authtoken']['admin_user'].strip
|
||||
g['admin_password'] = glance_file['keystone_authtoken']['admin_password'].strip
|
||||
g['auth_url'] = glance_file['keystone_authtoken']['auth_url'].strip
|
||||
g['project_name'] = glance_file['keystone_authtoken']['project_name'].strip
|
||||
g['username'] = glance_file['keystone_authtoken']['username'].strip
|
||||
g['password'] = glance_file['keystone_authtoken']['password'].strip
|
||||
g['os_region_name'] = glance_file['glance_store']['os_region_name'].strip
|
||||
|
||||
return g
|
||||
@ -79,8 +79,8 @@ class Puppet::Provider::Glance < Puppet::Provider::Openstack
|
||||
|
||||
def self.get_auth_endpoint
|
||||
g = glance_credentials
|
||||
if g.key?('identity_uri')
|
||||
"#{g['identity_uri']}/"
|
||||
if g.key?('auth_url')
|
||||
"#{g['auth_url']}/"
|
||||
else
|
||||
"#{g['auth_protocol']}://#{g['auth_host']}:#{g['auth_port']}#{g['auth_admin_prefix']}/v2.0/"
|
||||
end
|
||||
|
167
manifests/api.pp
167
manifests/api.pp
@ -4,9 +4,6 @@
|
||||
#
|
||||
# == Parameters
|
||||
#
|
||||
# [*keystone_password*]
|
||||
# (required) Password used to authentication.
|
||||
#
|
||||
# [*package_ensure*]
|
||||
# (optional) Ensure state for package. On RedHat platforms this
|
||||
# setting is ignored and the setting from the glance class is used
|
||||
@ -62,31 +59,15 @@
|
||||
# (optional) Turn on/off delayed delete.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*auth_type*]
|
||||
# [*auth_strategy*]
|
||||
# (optional) Type is authorization being used.
|
||||
# Defaults to 'keystone'
|
||||
#
|
||||
# [*auth_uri*]
|
||||
# (optional) Complete public Identity API endpoint.
|
||||
# Defaults to 'http://127.0.0.1:5000/'.
|
||||
#
|
||||
# [*identity_uri*]
|
||||
# (optional) Complete admin Identity API endpoint.
|
||||
# Defaults to 'http://127.0.0.1:35357/'.
|
||||
#
|
||||
# [*pipeline*]
|
||||
# (optional) Partial name of a pipeline in your paste configuration file with the
|
||||
# service name removed.
|
||||
# Defaults to 'keystone'.
|
||||
#
|
||||
# [*keystone_tenant*]
|
||||
# (optional) Tenant to authenticate to.
|
||||
# Defaults to services.
|
||||
#
|
||||
# [*keystone_user*]
|
||||
# (optional) User to authenticate as with keystone.
|
||||
# Defaults to 'glance'.
|
||||
#
|
||||
# [*manage_service*]
|
||||
# (optional) If Puppet should manage service startup / shutdown.
|
||||
# Defaults to true.
|
||||
@ -213,21 +194,6 @@
|
||||
# (optional) Sets the keystone region to use.
|
||||
# Defaults to 'RegionOne'.
|
||||
#
|
||||
# [*signing_dir*]
|
||||
# (optional) Directory used to cache files related to PKI tokens.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*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 $::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.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*enable_proxy_headers_parsing*]
|
||||
# (Optional) Enable paste middleware to handle SSL requests through
|
||||
# HTTPProxyToWSGI middleware.
|
||||
@ -272,8 +238,55 @@
|
||||
# then region name can be specified.
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*keystone_password*]
|
||||
# (Optional) Password used to authentication.
|
||||
# Deprecated and will be replaced by ::glance::api::authtoken::password
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*auth_type*]
|
||||
# (optional) Type is authorization being used.
|
||||
# Deprecated and replaced by ::glance::api::auth_strategy
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*auth_uri*]
|
||||
# (optional) Complete public Identity API endpoint.
|
||||
# Deprecated and will be replaced by ::glance::api::authtoken::auth_uri
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*identity_uri*]
|
||||
# (optional) Complete admin Identity API endpoint.
|
||||
# Deprecated and will be replaced by ::glance::api::authtoken::auth_url
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*keystone_tenant*]
|
||||
# (optional) Tenant to authenticate to.
|
||||
# Deprecated and will be replaced by ::glance::api::authtoken::project_name
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*keystone_user*]
|
||||
# (optional) User to authenticate as with keystone.
|
||||
# Deprecated and will be replaced by ::glance::api::authtoken::username
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*signing_dir*]
|
||||
# (optional) Directory used to cache files related to PKI tokens.
|
||||
# Deprecated and will be replaced by ::glance::api::authtoken::signing_dir
|
||||
# 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.
|
||||
# Deprecated and will be replaced by ::glance::api::authtoken::memcached_servers
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*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.
|
||||
# Deprecated and will be replaced by ::glance::api::authtoken::token_cache_time
|
||||
# Defaults to undef.
|
||||
#
|
||||
class glance::api(
|
||||
$keystone_password,
|
||||
$package_ensure = 'present',
|
||||
$debug = undef,
|
||||
$bind_host = $::os_service_default,
|
||||
@ -287,13 +300,8 @@ class glance::api(
|
||||
$registry_client_protocol = $::os_service_default,
|
||||
$scrub_time = $::os_service_default,
|
||||
$delayed_delete = $::os_service_default,
|
||||
$auth_type = 'keystone',
|
||||
$auth_uri = 'http://127.0.0.1:5000/',
|
||||
$identity_uri = 'http://127.0.0.1:35357/',
|
||||
$memcached_servers = $::os_service_default,
|
||||
$auth_strategy = 'keystone',
|
||||
$pipeline = 'keystone',
|
||||
$keystone_tenant = 'services',
|
||||
$keystone_user = 'glance',
|
||||
$manage_service = true,
|
||||
$enabled = true,
|
||||
$use_syslog = undef,
|
||||
@ -323,8 +331,6 @@ class glance::api(
|
||||
$image_cache_stall_time = $::os_service_default,
|
||||
$image_cache_dir = '/var/lib/glance/image-cache',
|
||||
$os_region_name = 'RegionOne',
|
||||
$signing_dir = $::os_service_default,
|
||||
$token_cache_time = $::os_service_default,
|
||||
$enable_proxy_headers_parsing = $::os_service_default,
|
||||
$validate = false,
|
||||
$validation_options = {},
|
||||
@ -332,6 +338,15 @@ class glance::api(
|
||||
$known_stores = false,
|
||||
$verbose = undef,
|
||||
$auth_region = undef,
|
||||
$keystone_password = undef,
|
||||
$auth_type = undef,
|
||||
$auth_uri = undef,
|
||||
$identity_uri = undef,
|
||||
$keystone_tenant = undef,
|
||||
$keystone_user = undef,
|
||||
$memcached_servers = undef,
|
||||
$signing_dir = undef,
|
||||
$token_cache_time = undef,
|
||||
) inherits glance {
|
||||
|
||||
include ::glance::deps
|
||||
@ -348,6 +363,45 @@ class glance::api(
|
||||
warning('auth_region is deprecated, has no effect and and will be removed in the O release.')
|
||||
}
|
||||
|
||||
if $keystone_password {
|
||||
warning('glance::api::keystone_password is deprecated, please use glance::api::authtoken::password')
|
||||
}
|
||||
|
||||
if $auth_type {
|
||||
warning('glance::api::auth_type is deprecated, please use glance::api::auth_strategy')
|
||||
$auth_strategy_real = $auth_type
|
||||
} else {
|
||||
$auth_strategy_real = $auth_strategy
|
||||
}
|
||||
|
||||
if $auth_uri {
|
||||
warning('glance::api::auth_uri is deprecated, please use glance::api::authtoken::auth_uri')
|
||||
}
|
||||
|
||||
if $identity_uri {
|
||||
warning('glance::api::identity_uri is deprecated, please use glance::api::authtoken::auth_url')
|
||||
}
|
||||
|
||||
if $keystone_tenant {
|
||||
warning('glance::api::keystone_tenant is deprecated, please use glance::api::authtoken::project_name')
|
||||
}
|
||||
|
||||
if $keystone_user {
|
||||
warning('glance::api::keystone_user is deprecated, please use glance::api::authtoken::username')
|
||||
}
|
||||
|
||||
if $memcached_servers {
|
||||
warning('glance::api::memcached_servers is deprecated, please use glance::api::authtoken::memcached_servers')
|
||||
}
|
||||
|
||||
if $signing_dir {
|
||||
warning('glance::api::signing_dir is deprecated, please use glance::api::authtoken::signing_dir')
|
||||
}
|
||||
|
||||
if $token_cache_time {
|
||||
warning('glance::api::token_cache_time is deprecated, please use glance::api::authtoken::token_cache_time')
|
||||
}
|
||||
|
||||
if ( $glance::params::api_package_name != $glance::params::registry_package_name ) {
|
||||
ensure_packages('glance-api',
|
||||
{
|
||||
@ -459,23 +513,8 @@ class glance::api(
|
||||
}
|
||||
|
||||
# keystone config
|
||||
if $auth_type == 'keystone' {
|
||||
glance_api_config {
|
||||
'keystone_authtoken/admin_tenant_name': value => $keystone_tenant;
|
||||
'keystone_authtoken/admin_user': value => $keystone_user;
|
||||
'keystone_authtoken/admin_password': value => $keystone_password, secret => true;
|
||||
'keystone_authtoken/token_cache_time': value => $token_cache_time;
|
||||
'keystone_authtoken/signing_dir': value => $signing_dir;
|
||||
'keystone_authtoken/auth_uri': value => $auth_uri;
|
||||
'keystone_authtoken/identity_uri': value => $identity_uri;
|
||||
'keystone_authtoken/memcached_servers': value => join(any2array($memcached_servers), ',');
|
||||
}
|
||||
glance_cache_config {
|
||||
'DEFAULT/auth_url' : value => $auth_uri;
|
||||
'DEFAULT/admin_tenant_name': value => $keystone_tenant;
|
||||
'DEFAULT/admin_user' : value => $keystone_user;
|
||||
'DEFAULT/admin_password' : value => $keystone_password, secret => true;
|
||||
}
|
||||
if $auth_strategy_real == 'keystone' {
|
||||
include ::glance::api::authtoken
|
||||
}
|
||||
|
||||
oslo::middleware { 'glance_api_config':
|
||||
@ -510,9 +549,13 @@ class glance::api(
|
||||
}
|
||||
|
||||
if $validate {
|
||||
$keystone_tenant_real = pick($keystone_tenant, $::glance::api::authtoken::project_name)
|
||||
$keystone_username_real = pick($keystone_user, $::glance::api::authtoken::username)
|
||||
$keystone_password_real = pick($keystone_password, $::glance::api::authtoken::password)
|
||||
$auth_uri_real = pick($auth_uri, $::glance::api::authtoken::auth_uri)
|
||||
$defaults = {
|
||||
'glance-api' => {
|
||||
'command' => "glance --os-auth-url ${auth_uri} --os-tenant-name ${keystone_tenant} --os-username ${keystone_user} --os-password ${keystone_password} image-list",
|
||||
'command' => "glance --os-auth-url ${auth_uri_real} --os-project-name ${keystone_tenant_real} --os-username ${keystone_username_real} --os-password ${keystone_password_real} image-list",
|
||||
}
|
||||
}
|
||||
$validation_options_hash = merge ($defaults, $validation_options)
|
||||
|
282
manifests/api/authtoken.pp
Normal file
282
manifests/api/authtoken.pp
Normal file
@ -0,0 +1,282 @@
|
||||
# class: glance::api::authtoken
|
||||
#
|
||||
# Configure the keystone_authtoken section in the Glance API configuration file
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*username*]
|
||||
# (Optional) The name of the service user
|
||||
# Defaults to 'glance'
|
||||
#
|
||||
# [*password*]
|
||||
# (Optional) Password to create for the service user
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*auth_url*]
|
||||
# (Optional) The URL to use for authentication.
|
||||
# Defaults to 'http://127.0.0.1:35357'
|
||||
#
|
||||
# [*project_name*]
|
||||
# (Optional) Service project name
|
||||
# Defaults to 'services'
|
||||
#
|
||||
# [*user_domain_name*]
|
||||
# (Optional) Name of domain for $username
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*project_domain_name*]
|
||||
# (Optional) Name of domain for $project_name
|
||||
# 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
|
||||
#
|
||||
# [*auth_section*]
|
||||
# (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'
|
||||
#
|
||||
# [*auth_uri*]
|
||||
# (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.
|
||||
#
|
||||
# [*cache*]
|
||||
# (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.
|
||||
#
|
||||
# [*certfile*]
|
||||
# (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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*http_connect_timeout*]
|
||||
# (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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*keyfile*]
|
||||
# (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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*memcache_pool_maxsize*]
|
||||
# (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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*memcache_secret_key*]
|
||||
# (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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*region_name*]
|
||||
# (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.
|
||||
#
|
||||
# [*signing_dir*]
|
||||
# (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.
|
||||
#
|
||||
class glance::api::authtoken(
|
||||
$username = 'glance',
|
||||
$password = $::os_service_default,
|
||||
$auth_url = 'http://127.0.0.1:35357',
|
||||
$project_name = 'services',
|
||||
$user_domain_name = $::os_service_default,
|
||||
$project_domain_name = $::os_service_default,
|
||||
$insecure = $::os_service_default,
|
||||
$auth_section = $::os_service_default,
|
||||
$auth_type = 'password',
|
||||
$auth_uri = 'http://127.0.0.1:5000',
|
||||
$auth_version = $::os_service_default,
|
||||
$cache = $::os_service_default,
|
||||
$cafile = $::os_service_default,
|
||||
$certfile = $::os_service_default,
|
||||
$check_revocations_for_cached = $::os_service_default,
|
||||
$delay_auth_decision = $::os_service_default,
|
||||
$enforce_token_bind = $::os_service_default,
|
||||
$hash_algorithms = $::os_service_default,
|
||||
$http_connect_timeout = $::os_service_default,
|
||||
$http_request_max_retries = $::os_service_default,
|
||||
$include_service_catalog = $::os_service_default,
|
||||
$keyfile = $::os_service_default,
|
||||
$memcache_pool_conn_get_timeout = $::os_service_default,
|
||||
$memcache_pool_dead_retry = $::os_service_default,
|
||||
$memcache_pool_maxsize = $::os_service_default,
|
||||
$memcache_pool_socket_timeout = $::os_service_default,
|
||||
$memcache_pool_unused_timeout = $::os_service_default,
|
||||
$memcache_secret_key = $::os_service_default,
|
||||
$memcache_security_strategy = $::os_service_default,
|
||||
$memcache_use_advanced_pool = $::os_service_default,
|
||||
$memcached_servers = $::os_service_default,
|
||||
$region_name = $::os_service_default,
|
||||
$revocation_cache_time = $::os_service_default,
|
||||
$signing_dir = $::os_service_default,
|
||||
$token_cache_time = $::os_service_default,
|
||||
) {
|
||||
|
||||
if is_service_default($password) and $::glance::api::keystone_password == undef {
|
||||
fail('Please set password for Glance service user')
|
||||
}
|
||||
|
||||
#NOTE(degorenko): Use pick to keep backward compatibility
|
||||
$username_real = pick($::glance::api::keystone_user, $username)
|
||||
$password_real = pick($::glance::api::keystone_password, $password)
|
||||
$project_name_real = pick($::glance::api::keystone_tenant, $project_name)
|
||||
$auth_url_real = pick($::glance::api::identity_uri, $auth_url)
|
||||
$auth_uri_real = pick($::glance::api::auth_uri, $auth_uri)
|
||||
$memcached_servers_real = pick($::glance::api::memcached_servers, $memcached_servers)
|
||||
$token_cache_time_real = pick($::glance::api::token_cache_time, $token_cache_time)
|
||||
$signing_dir_real = pick($::glance::api::signing_dir, $signing_dir)
|
||||
|
||||
keystone::resource::authtoken { 'glance_api_config':
|
||||
username => $username_real,
|
||||
password => $password_real,
|
||||
project_name => $project_name_real,
|
||||
auth_url => $auth_url_real,
|
||||
auth_uri => $auth_uri_real,
|
||||
auth_version => $auth_version,
|
||||
auth_type => $auth_type,
|
||||
auth_section => $auth_section,
|
||||
user_domain_name => $user_domain_name,
|
||||
project_domain_name => $project_domain_name,
|
||||
insecure => $insecure,
|
||||
cache => $cache,
|
||||
cafile => $cafile,
|
||||
certfile => $certfile,
|
||||
check_revocations_for_cached => $check_revocations_for_cached,
|
||||
delay_auth_decision => $delay_auth_decision,
|
||||
enforce_token_bind => $enforce_token_bind,
|
||||
hash_algorithms => $hash_algorithms,
|
||||
http_connect_timeout => $http_connect_timeout,
|
||||
http_request_max_retries => $http_request_max_retries,
|
||||
include_service_catalog => $include_service_catalog,
|
||||
keyfile => $keyfile,
|
||||
memcache_pool_conn_get_timeout => $memcache_pool_conn_get_timeout,
|
||||
memcache_pool_dead_retry => $memcache_pool_dead_retry,
|
||||
memcache_pool_maxsize => $memcache_pool_maxsize,
|
||||
memcache_pool_socket_timeout => $memcache_pool_socket_timeout,
|
||||
memcache_secret_key => $memcache_secret_key,
|
||||
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,
|
||||
region_name => $region_name,
|
||||
revocation_cache_time => $revocation_cache_time,
|
||||
signing_dir => $signing_dir_real,
|
||||
token_cache_time => $token_cache_time_real,
|
||||
}
|
||||
}
|
@ -25,35 +25,15 @@
|
||||
# (optional) Number of Glance Glare worker processes to start
|
||||
# Default: $::processorcount
|
||||
#
|
||||
# [*auth_type*]
|
||||
# [*auth_strategy*]
|
||||
# (optional) Type is authorization being used.
|
||||
# Defaults to 'keystone'
|
||||
#
|
||||
# [*auth_uri*]
|
||||
# (optional) Complete public Identity API endpoint.
|
||||
# Defaults to 'http://127.0.0.1:5000/'.
|
||||
#
|
||||
# [*identity_uri*]
|
||||
# (optional) Complete admin Identity API endpoint.
|
||||
# Defaults to 'http://127.0.0.1:35357/'.
|
||||
#
|
||||
# [*pipeline*]
|
||||
# (optional) Partial name of a pipeline in your paste configuration file with the
|
||||
# service name removed.
|
||||
# Defaults to 'keystone'.
|
||||
#
|
||||
# [*keystone_tenant*]
|
||||
# (optional) Tenant to authenticate to.
|
||||
# Defaults to services.
|
||||
#
|
||||
# [*keystone_user*]
|
||||
# (optional) User to authenticate as with keystone.
|
||||
# Defaults to 'glance'.
|
||||
#
|
||||
# [*keystone_password*]
|
||||
# (optional) Password used to authentication.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*manage_service*]
|
||||
# (optional) If Puppet should manage service startup / shutdown.
|
||||
# Defaults to true.
|
||||
@ -93,21 +73,6 @@
|
||||
# (optional) Sets the keystone region to use.
|
||||
# Defaults to 'RegionOne'.
|
||||
#
|
||||
# [*signing_dir*]
|
||||
# (optional) Directory used to cache files related to PKI tokens.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*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 $::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.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# == DEPRECATED PARAMETERS
|
||||
#
|
||||
# [*auth_region*]
|
||||
@ -116,20 +81,62 @@
|
||||
# then region name can be specified.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*auth_type*]
|
||||
# (optional) Type is authorization being used.
|
||||
# Deprecated and replaced by ::glance::glare::auth_strategy
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*auth_uri*]
|
||||
# (optional) Complete public Identity API endpoint.
|
||||
# Deprecated and will be replaced by ::glance::glare::authtoken::auth_uri
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*identity_uri*]
|
||||
# (optional) Complete admin Identity API endpoint.
|
||||
# Deprecated and will be replaced by ::glance::glare::authtoken::auth_url
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*keystone_tenant*]
|
||||
# (optional) Tenant to authenticate to.
|
||||
# Deprecated and will be replaced by ::glance::glare::authtoken::project_name
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*keystone_user*]
|
||||
# (optional) User to authenticate as with keystone.
|
||||
# Deprecated and will be replaced by ::glance::glare::authtoken::username
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*keystone_password*]
|
||||
# (optional) Password used to authentication.
|
||||
# Deprecated and will be replaced by ::glance::glare::authtoken::password
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*signing_dir*]
|
||||
# (optional) Directory used to cache files related to PKI tokens.
|
||||
# Deprecated and will be replaced by ::glance::glare::authtoken::signing_dir
|
||||
# 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.
|
||||
# Deprecated and will be replaced by ::glance::glare::authtoken::memcached_servers
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*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.
|
||||
# Deprecated and will be replaced by ::glance::glare::authtoken::token_cache_time
|
||||
# Defaults to undef.
|
||||
#
|
||||
class glance::glare(
|
||||
$package_ensure = 'present',
|
||||
$bind_host = '0.0.0.0',
|
||||
$bind_port = '9494',
|
||||
$backlog = '4096',
|
||||
$workers = $::processorcount,
|
||||
$auth_type = 'keystone',
|
||||
$auth_uri = 'http://127.0.0.1:5000/',
|
||||
$identity_uri = 'http://127.0.0.1:35357/',
|
||||
$memcached_servers = $::os_service_default,
|
||||
$auth_strategy = 'keystone',
|
||||
$pipeline = 'keystone',
|
||||
$keystone_tenant = 'services',
|
||||
$keystone_user = 'glance',
|
||||
$keystone_password = false,
|
||||
$manage_service = true,
|
||||
$enabled = true,
|
||||
$cert_file = $::os_service_default,
|
||||
@ -139,10 +146,17 @@ class glance::glare(
|
||||
$default_store = undef,
|
||||
$multi_store = false,
|
||||
$os_region_name = 'RegionOne',
|
||||
$signing_dir = $::os_service_default,
|
||||
$token_cache_time = $::os_service_default,
|
||||
# DEPRECATED PARAMETERS
|
||||
$auth_region = $::os_service_default,
|
||||
$auth_region = undef,
|
||||
$auth_type = undef,
|
||||
$auth_uri = undef,
|
||||
$identity_uri = undef,
|
||||
$memcached_servers = undef,
|
||||
$keystone_tenant = undef,
|
||||
$keystone_user = undef,
|
||||
$keystone_password = undef,
|
||||
$signing_dir = undef,
|
||||
$token_cache_time = undef,
|
||||
) inherits glance {
|
||||
|
||||
include ::glance::deps
|
||||
@ -154,6 +168,45 @@ class glance::glare(
|
||||
warning('auth_region is deprecated, has no effect and and will be removed in the O release.')
|
||||
}
|
||||
|
||||
if $keystone_password {
|
||||
warning('glance::glare::keystone_password is deprecated, please use glance::glare::authtoken::password')
|
||||
}
|
||||
|
||||
if $auth_type {
|
||||
warning('glance::glare::auth_type is deprecated, please use glance::glare::auth_strategy')
|
||||
$auth_strategy_real = $auth_type
|
||||
} else {
|
||||
$auth_strategy_real = $auth_strategy
|
||||
}
|
||||
|
||||
if $auth_uri {
|
||||
warning('glance::glare::auth_uri is deprecated, please use glance::glare::authtoken::auth_uri')
|
||||
}
|
||||
|
||||
if $identity_uri {
|
||||
warning('glance::glare::identity_uri is deprecated, please use glance::glare::authtoken::auth_url')
|
||||
}
|
||||
|
||||
if $keystone_tenant {
|
||||
warning('glance::glare::keystone_tenant is deprecated, please use glance::glare::authtoken::project_name')
|
||||
}
|
||||
|
||||
if $keystone_user {
|
||||
warning('glance::glare::keystone_user is deprecated, please use glance::glare::authtoken::username')
|
||||
}
|
||||
|
||||
if $memcached_servers {
|
||||
warning('glance::glare::memcached_servers is deprecated, please use glance::glare::authtoken::memcached_servers')
|
||||
}
|
||||
|
||||
if $signing_dir {
|
||||
warning('glance::glare::signing_dir is deprecated, please use glance::glare::authtoken::signing_dir')
|
||||
}
|
||||
|
||||
if $token_cache_time {
|
||||
warning('glance::glare::token_cache_time is deprecated, please use glance::glare::authtoken::token_cache_time')
|
||||
}
|
||||
|
||||
if ( $glance::params::glare_package_name != $glance::params::registry_package_name ) {
|
||||
ensure_packages('glance-glare', {
|
||||
ensure => $package_ensure,
|
||||
@ -222,20 +275,8 @@ class glance::glare(
|
||||
}
|
||||
|
||||
# keystone config
|
||||
if $auth_type == 'keystone' {
|
||||
if ! $keystone_password {
|
||||
fail('Parameter keystone_password must be provided, when auth_type is keystone')
|
||||
}
|
||||
glance_glare_config {
|
||||
'keystone_authtoken/admin_tenant_name': value => $keystone_tenant;
|
||||
'keystone_authtoken/admin_user': value => $keystone_user;
|
||||
'keystone_authtoken/admin_password': value => $keystone_password, secret => true;
|
||||
'keystone_authtoken/token_cache_time': value => $token_cache_time;
|
||||
'keystone_authtoken/signing_dir': value => $signing_dir;
|
||||
'keystone_authtoken/auth_uri': value => $auth_uri;
|
||||
'keystone_authtoken/identity_uri': value => $identity_uri;
|
||||
'keystone_authtoken/memcached_servers': value => join(any2array($memcached_servers), ',');
|
||||
}
|
||||
if $auth_strategy == 'keystone' {
|
||||
include ::glance::glare::authtoken
|
||||
}
|
||||
|
||||
# SSL Options
|
||||
|
282
manifests/glare/authtoken.pp
Normal file
282
manifests/glare/authtoken.pp
Normal file
@ -0,0 +1,282 @@
|
||||
# class: glance::glare::authtoken
|
||||
#
|
||||
# Configure the keystone_authtoken section in the Glance Glare configuration file
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*username*]
|
||||
# (Optional) The name of the service user
|
||||
# Defaults to 'glance'
|
||||
#
|
||||
# [*password*]
|
||||
# (Optional) Password to create for the service user
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*auth_url*]
|
||||
# (Optional) The URL to use for authentication.
|
||||
# Defaults to 'http://127.0.0.1:35357'
|
||||
#
|
||||
# [*project_name*]
|
||||
# (Optional) Service project name
|
||||
# Defaults to 'services'
|
||||
#
|
||||
# [*user_domain_name*]
|
||||
# (Optional) Name of domain for $username
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*project_domain_name*]
|
||||
# (Optional) Name of domain for $project_name
|
||||
# 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
|
||||
#
|
||||
# [*auth_section*]
|
||||
# (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'
|
||||
#
|
||||
# [*auth_uri*]
|
||||
# (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.
|
||||
#
|
||||
# [*cache*]
|
||||
# (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.
|
||||
#
|
||||
# [*certfile*]
|
||||
# (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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*http_connect_timeout*]
|
||||
# (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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*keyfile*]
|
||||
# (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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*memcache_pool_maxsize*]
|
||||
# (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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*memcache_secret_key*]
|
||||
# (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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*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.
|
||||
#
|
||||
# [*region_name*]
|
||||
# (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.
|
||||
#
|
||||
# [*signing_dir*]
|
||||
# (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.
|
||||
#
|
||||
class glance::glare::authtoken(
|
||||
$username = 'glance',
|
||||
$password = $::os_service_default,
|
||||
$auth_url = 'http://127.0.0.1:35357',
|
||||
$project_name = 'services',
|
||||
$user_domain_name = $::os_service_default,
|
||||
$project_domain_name = $::os_service_default,
|
||||
$insecure = $::os_service_default,
|
||||
$auth_section = $::os_service_default,
|
||||
$auth_type = 'password',
|
||||
$auth_uri = 'http://127.0.0.1:5000',
|
||||
$auth_version = $::os_service_default,
|
||||
$cache = $::os_service_default,
|
||||
$cafile = $::os_service_default,
|
||||
$certfile = $::os_service_default,
|
||||
$check_revocations_for_cached = $::os_service_default,
|
||||
$delay_auth_decision = $::os_service_default,
|
||||
$enforce_token_bind = $::os_service_default,
|
||||
$hash_algorithms = $::os_service_default,
|
||||
$http_connect_timeout = $::os_service_default,
|
||||
$http_request_max_retries = $::os_service_default,
|
||||
$include_service_catalog = $::os_service_default,
|
||||
$keyfile = $::os_service_default,
|
||||
$memcache_pool_conn_get_timeout = $::os_service_default,
|
||||
$memcache_pool_dead_retry = $::os_service_default,
|
||||
$memcache_pool_maxsize = $::os_service_default,
|
||||
$memcache_pool_socket_timeout = $::os_service_default,
|
||||
$memcache_pool_unused_timeout = $::os_service_default,
|
||||
$memcache_secret_key = $::os_service_default,
|
||||
$memcache_security_strategy = $::os_service_default,
|
||||
$memcache_use_advanced_pool = $::os_service_default,
|
||||
$memcached_servers = $::os_service_default,
|
||||
$region_name = $::os_service_default,
|
||||
$revocation_cache_time = $::os_service_default,
|
||||
$signing_dir = $::os_service_default,
|
||||
$token_cache_time = $::os_service_default,
|
||||
) {
|
||||
|
||||
if is_service_default($password) and $::glance::glare::keystone_password == undef {
|
||||
fail('Please set password for Glance service user')
|
||||
}
|
||||
|
||||
#NOTE(degorenko): Use pick to keep backward compatibility
|
||||
$username_real = pick($::glance::glare::keystone_user, $username)
|
||||
$password_real = pick($::glance::glare::keystone_password, $password)
|
||||
$project_name_real = pick($::glance::glare::keystone_tenant, $project_name)
|
||||
$auth_url_real = pick($::glance::glare::identity_uri, $auth_url)
|
||||
$auth_uri_real = pick($::glance::glare::auth_uri, $auth_uri)
|
||||
$memcached_servers_real = pick($::glance::glare::memcached_servers, $memcached_servers)
|
||||
$token_cache_time_real = pick($::glance::glare::token_cache_time, $token_cache_time)
|
||||
$signing_dir_real = pick($::glance::glare::signing_dir, $signing_dir)
|
||||
|
||||
keystone::resource::authtoken { 'glance_glare_config':
|
||||
username => $username_real,
|
||||
password => $password_real,
|
||||
project_name => $project_name_real,
|
||||
auth_url => $auth_url_real,
|
||||
auth_uri => $auth_uri_real,
|
||||
auth_version => $auth_version,
|
||||
auth_type => $auth_type,
|
||||
auth_section => $auth_section,
|
||||
user_domain_name => $user_domain_name,
|
||||
project_domain_name => $project_domain_name,
|
||||
insecure => $insecure,
|
||||
cache => $cache,
|
||||
cafile => $cafile,
|
||||
certfile => $certfile,
|
||||
check_revocations_for_cached => $check_revocations_for_cached,
|
||||
delay_auth_decision => $delay_auth_decision,
|
||||
enforce_token_bind => $enforce_token_bind,
|
||||
hash_algorithms => $hash_algorithms,
|
||||
http_connect_timeout => $http_connect_timeout,
|
||||
http_request_max_retries => $http_request_max_retries,
|
||||
include_service_catalog => $include_service_catalog,
|
||||
keyfile => $keyfile,
|
||||
memcache_pool_conn_get_timeout => $memcache_pool_conn_get_timeout,
|
||||
memcache_pool_dead_retry => $memcache_pool_dead_retry,
|
||||
memcache_pool_maxsize => $memcache_pool_maxsize,
|
||||
memcache_pool_socket_timeout => $memcache_pool_socket_timeout,
|
||||
memcache_secret_key => $memcache_secret_key,
|
||||
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,
|
||||
region_name => $region_name,
|
||||
revocation_cache_time => $revocation_cache_time,
|
||||
signing_dir => $signing_dir_real,
|
||||
token_cache_time => $token_cache_time_real,
|
||||
}
|
||||
}
|
@ -4,9 +4,6 @@
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*keystone_password*]
|
||||
# (required) The keystone password for administrative user
|
||||
#
|
||||
# [*package_ensure*]
|
||||
# (optional) Ensure state for package. Defaults to 'present'. On RedHat
|
||||
# platforms this setting is ignored and the setting from the glance class is
|
||||
@ -66,24 +63,9 @@
|
||||
# (optional) If set, use this value for max_overflow with sqlalchemy.
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*auth_type*]
|
||||
# (optional) Authentication type. Defaults to 'keystone'.
|
||||
#
|
||||
# [*auth_uri*]
|
||||
# (optional) Complete public Identity API endpoint.
|
||||
# Defaults to 'http://127.0.0.1:5000/'.
|
||||
#
|
||||
# [*identity_uri*]
|
||||
# (optional) Complete admin Identity API endpoint.
|
||||
# Defaults to 'http://127.0.0.1:35357/'.
|
||||
#
|
||||
# [*keystone_tenant*]
|
||||
# (optional) administrative tenant name to connect to keystone.
|
||||
# Defaults to 'services'.
|
||||
#
|
||||
# [*keystone_user*]
|
||||
# (optional) administrative user name to connect to keystone.
|
||||
# Defaults to 'glance'.
|
||||
# [*auth_strategy*]
|
||||
# (optional) Type is authorization being used.
|
||||
# Defaults to 'keystone'
|
||||
#
|
||||
# [*pipeline*]
|
||||
# (optional) Partial name of a pipeline in your paste configuration
|
||||
@ -135,28 +117,59 @@
|
||||
# (optional) Sets the keystone region to use.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*signing_dir*]
|
||||
# Directory used to cache files related to PKI tokens.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*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 $::os_service_default.
|
||||
#
|
||||
# [*token_cache_time*]
|
||||
# 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.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# DEPRECATED PARAMETERS
|
||||
#
|
||||
# [*verbose*]
|
||||
# (optional) Deprecated. Enable verbose logs (true|false). Defaults to undef.
|
||||
#
|
||||
# [*keystone_password*]
|
||||
# (optional) The keystone password for administrative user.
|
||||
# Deprecated and will be replaced by ::glance::registry::authtoken::password
|
||||
# Default to undef.
|
||||
#
|
||||
# [*auth_type*]
|
||||
# (optional) Authentication type. Defaults to undef.
|
||||
# Deprecated and will be replaced by ::glance::registry::auth_strategy
|
||||
#
|
||||
# [*auth_uri*]
|
||||
# (optional) Complete public Identity API endpoint.
|
||||
# Deprecated and will be replaced by ::glance::registry::authtoken::auth_uri
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*identity_uri*]
|
||||
# (optional) Complete admin Identity API endpoint.
|
||||
# Deprecated and will be replaced by ::glance::registry::authtoken::auth_url
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*keystone_tenant*]
|
||||
# (optional) administrative tenant name to connect to keystone.
|
||||
# Deprecated and will be replaced by ::glance::registry::authtoken::project_name
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*keystone_user*]
|
||||
# (optional) administrative user name to connect to keystone.
|
||||
# Deprecated and will be replaced by ::glance::registry::authtoken::username
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*signing_dir*]
|
||||
# Directory used to cache files related to PKI tokens.
|
||||
# Deprecated and will be replaced by ::glance::registry::authtoken::signing_dir
|
||||
# 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.
|
||||
# Deprecated and will be replaced by ::glance::registry::authtoken::memcached_servers
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*token_cache_time*]
|
||||
# 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.
|
||||
# Deprecated and will be replaced by ::glance::registry::authtoken::token_cache_time
|
||||
# Defaults to undef.
|
||||
#
|
||||
class glance::registry(
|
||||
$keystone_password,
|
||||
$package_ensure = 'present',
|
||||
$debug = undef,
|
||||
$bind_host = $::os_service_default,
|
||||
@ -171,11 +184,7 @@ class glance::registry(
|
||||
$database_max_retries = undef,
|
||||
$database_retry_interval = undef,
|
||||
$database_max_overflow = undef,
|
||||
$auth_type = 'keystone',
|
||||
$auth_uri = 'http://127.0.0.1:5000/',
|
||||
$identity_uri = 'http://127.0.0.1:35357/',
|
||||
$keystone_tenant = 'services',
|
||||
$keystone_user = 'glance',
|
||||
$auth_strategy = 'keystone',
|
||||
$pipeline = 'keystone',
|
||||
$use_syslog = undef,
|
||||
$use_stderr = undef,
|
||||
@ -188,11 +197,17 @@ class glance::registry(
|
||||
$ca_file = $::os_service_default,
|
||||
$sync_db = true,
|
||||
$os_region_name = $::os_service_default,
|
||||
$signing_dir = $::os_service_default,
|
||||
$memcached_servers = $::os_service_default,
|
||||
$token_cache_time = $::os_service_default,
|
||||
# Deprecated
|
||||
$verbose = undef,
|
||||
$keystone_password = undef,
|
||||
$auth_type = undef,
|
||||
$auth_uri = undef,
|
||||
$identity_uri = undef,
|
||||
$keystone_tenant = undef,
|
||||
$keystone_user = undef,
|
||||
$signing_dir = undef,
|
||||
$memcached_servers = undef,
|
||||
$token_cache_time = undef,
|
||||
) inherits glance {
|
||||
|
||||
include ::glance::deps
|
||||
@ -203,6 +218,45 @@ class glance::registry(
|
||||
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
|
||||
}
|
||||
|
||||
if $keystone_password {
|
||||
warning('glance::registry::keystone_password is deprecated, please use glance::registry::authtoken::password')
|
||||
}
|
||||
|
||||
if $auth_type {
|
||||
warning('glance::registry::auth_type is deprecated, please use glance::registry::auth_strategy')
|
||||
$auth_strategy_real = $auth_type
|
||||
} else {
|
||||
$auth_strategy_real = $auth_strategy
|
||||
}
|
||||
|
||||
if $auth_uri {
|
||||
warning('glance::registry::auth_uri is deprecated, please use glance::registry::authtoken::auth_uri')
|
||||
}
|
||||
|
||||
if $identity_uri {
|
||||
warning('glance::registry::identity_uri is deprecated, please use glance::registry::authtoken::auth_url')
|
||||
}
|
||||
|
||||
if $keystone_tenant {
|
||||
warning('glance::registry::keystone_tenant is deprecated, please use glance::registry::authtoken::project_name')
|
||||
}
|
||||
|
||||
if $keystone_user {
|
||||
warning('glance::registry::keystone_user is deprecated, please use glance::registry::authtoken::username')
|
||||
}
|
||||
|
||||
if $memcached_servers {
|
||||
warning('glance::registry::memcached_servers is deprecated, please use glance::registry::authtoken::memcached_servers')
|
||||
}
|
||||
|
||||
if $signing_dir {
|
||||
warning('glance::registry::signing_dir is deprecated, please use glance::registry::authtoken::signing_dir')
|
||||
}
|
||||
|
||||
if $token_cache_time {
|
||||
warning('glance::registry::token_cache_time is deprecated, please use glance::registry::authtoken::token_cache_time')
|
||||
}
|
||||
|
||||
if ( $glance::params::api_package_name != $glance::params::registry_package_name ) {
|
||||
ensure_packages( 'glance-registry',
|
||||
{
|
||||
@ -236,17 +290,8 @@ class glance::registry(
|
||||
}
|
||||
|
||||
# keystone config
|
||||