Format [keystone_authtoken] memcache_servers when IPv6 is used

When Memcached uses IPv6 network, the memcache_servers parameter should
be formatted as is described in the following example.
 inet6:[<host>]:<port>

This change ensures the proper format is applied even when hostnames
are used to define servers.

Also, this change fixes the timing to apply any2array. The function
should be applied before we check the first memcache server by [0],
otherwise the logic to detect IPv6 address does not work as intended.

Backport note to wallaby:
This change covers novajoin which was already removed in master.

Backport note to victoria:
 - Resolved the conflicts caused by [1]
 - Mistral and Zaqar are additionally covered by this backport
 - Fixed wrongly named spec file for zaqar::authtoken

[1] 34d78c5827

Conflicts:
	manifests/profile/base/aodh/authtoken.pp
	manifests/profile/base/barbican/authtoken.pp
	manifests/profile/base/cinder/authtoken.pp
	manifests/profile/base/designate/authtoken.pp
	manifests/profile/base/glance/authtoken.pp
	manifests/profile/base/gnocchi/authtoken.pp
	manifests/profile/base/heat/authtoken.pp
	manifests/profile/base/ironic/authtoken.pp
	manifests/profile/base/ironic_inspector/authtoken.pp
	manifests/profile/base/manila/authtoken.pp
	manifests/profile/base/neutron/authtoken.pp
	manifests/profile/base/nova/authtoken.pp
	manifests/profile/base/novajoin/authtoken.pp
	manifests/profile/base/octavia/authtoken.pp
	manifests/profile/base/placement/authtoken.pp

Backport note to ussuri:
Resolved conflict caused by missing spec file for the zaqar authtoken
class. The file was added during Victoria cycle.

Conflicts:
	spec/classes/tripleo_profile_base_zaqar_authtoken_spec.rb

Backport note to train:
Resolved conflict caused by mistral/novajoin/zaqar manifest which were
excluded when the previous change[2] was backported to stable/train
for unknown reason. Also, this backport covers Panko, which is no
longer supported in ussuri and later.

[2] https://review.opendev.org/c/openstack/puppet-tripleo/+/803205

Conflicts:
	manifests/profile/base/mistral/authtoken.pp
	manifests/profile/base/novajoin/authtoken.pp
	manifests/profile/base/zaqar/authtoken.pp
	spec/classes/tripleo_profile_base_mistral_authtoken_spec.rb
	spec/classes/tripleo_profile_base_novajoin_authtoken_spec.rb
	spec/classes/tripleo_profile_base_panko_authtoken_spec.rb

Partial-Bug: #1964824
Depends-on: https://review.opendev.org/834597
Change-Id: I18537ab819996cfb0f2705d8c49666d4b9bfff22
(cherry picked from commit 1e63b4c5f5)
(cherry picked from commit c868cbde88)
(cherry picked from commit 90f8544576)
(cherry picked from commit 564e844c38)
This commit is contained in:
Takashi Kajinami 2022-03-15 11:04:48 +09:00 committed by Harald Jensås
parent f6101ef640
commit 09d7754a5f
35 changed files with 554 additions and 159 deletions

View File

@ -31,6 +31,10 @@
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -50,18 +54,19 @@ class tripleo::profile::base::aodh::authtoken (
$step = Integer(hiera('step')),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = pick($memcached_ips, $memcached_hosts)
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -31,6 +31,10 @@
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -50,18 +54,19 @@ class tripleo::profile::base::barbican::authtoken (
$step = Integer(hiera('step')),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = pick($memcached_ips, $memcached_hosts)
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -31,6 +31,10 @@
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -50,18 +54,19 @@ class tripleo::profile::base::cinder::authtoken (
$step = Integer(hiera('step')),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = pick($memcached_ips, $memcached_hosts)
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -31,6 +31,10 @@
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -50,18 +54,19 @@ class tripleo::profile::base::designate::authtoken (
$step = Integer(hiera('step')),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = pick($memcached_ips, $memcached_hosts)
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -31,6 +31,10 @@
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -50,18 +54,19 @@ class tripleo::profile::base::glance::authtoken (
$step = Integer(hiera('step')),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = pick($memcached_ips, $memcached_hosts)
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -31,6 +31,10 @@
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -50,18 +54,19 @@ class tripleo::profile::base::gnocchi::authtoken (
$step = Integer(hiera('step')),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = pick($memcached_ips, $memcached_hosts)
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -31,6 +31,10 @@
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -50,18 +54,19 @@ class tripleo::profile::base::heat::authtoken (
$step = Integer(hiera('step')),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = pick($memcached_ips, $memcached_hosts)
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -31,6 +31,10 @@
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -50,18 +54,19 @@ class tripleo::profile::base::ironic::authtoken (
$step = Integer(hiera('step')),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = pick($memcached_ips, $memcached_hosts)
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -31,6 +31,10 @@
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -50,18 +54,19 @@ class tripleo::profile::base::ironic_inspector::authtoken (
$step = Integer(hiera('step')),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = pick($memcached_ips, $memcached_hosts)
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -31,6 +31,10 @@
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -50,18 +54,19 @@ class tripleo::profile::base::manila::authtoken (
$step = Integer(hiera('step')),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = pick($memcached_ips, $memcached_hosts)
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -16,19 +16,25 @@
#
# Mistral authtoken profile for TripleO
#
# === Parameters
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
# Defaults to hiera('step')
#
# [*memcached_ips*]
# (Optional) Array of ipv4 or ipv6 addresses for memcache.
# Defaults to hiera('memcached_node_ips', [])
# [*memcached_hosts*]
# (Optional) Array of hostnames, ipv4 or ipv6 addresses for memcache.
# Defaults to hiera('memcached_node_names', [])
#
# [*memcached_port*]
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -38,19 +44,29 @@
# The key is hashed with a salt, to isolate services.
# Defaults to hiera('memcached_authtoken_secret_key', undef)
#
# DEPRECATED PARAMETERS
#
# [*memcached_ips*]
# (Optional) Array of ipv4 or ipv6 addresses for memcache.
# Defaults to undef
#
class tripleo::profile::base::mistral::authtoken (
$step = Integer(hiera('step')),
$memcached_ips = hiera('memcached_node_ips', []),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_ips[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -31,6 +31,10 @@
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -50,18 +54,19 @@ class tripleo::profile::base::neutron::authtoken (
$step = Integer(hiera('step')),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = pick($memcached_ips, $memcached_hosts)
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -31,6 +31,10 @@
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -50,18 +54,19 @@ class tripleo::profile::base::nova::authtoken (
$step = Integer(hiera('step')),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = pick($memcached_ips, $memcached_hosts)
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -16,19 +16,25 @@
#
# Novajoin authtoken profile for TripleO
#
# === Parameters
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
# Defaults to hiera('step')
#
# [*memcached_ips*]
# (Optional) Array of ipv4 or ipv6 addresses for memcache.
# Defaults to hiera('memcached_node_ips', [])
# [*memcached_hosts*]
# (Optional) Array of hostnames, ipv4 or ipv6 addresses for memcache.
# Defaults to hiera('memcached_node_names', [])
#
# [*memcached_port*]
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -38,19 +44,29 @@
# The key is hashed with a salt, to isolate services.
# Defaults to hiera('memcached_authtoken_secret_key', undef)
#
# DEPRECATED PARAMETERS
#
# [*memcached_ips*]
# (Optional) Array of ipv4 or ipv6 addresses for memcache.
# Defaults to undef
#
class tripleo::profile::base::novajoin::authtoken (
$step = Integer(hiera('step')),
$memcached_ips = hiera('memcached_node_ips', []),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_ips[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -31,6 +31,10 @@
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -50,18 +54,19 @@ class tripleo::profile::base::octavia::authtoken (
$step = Integer(hiera('step')),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = pick($memcached_ips, $memcached_hosts)
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -31,6 +31,10 @@
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -50,22 +54,23 @@ class tripleo::profile::base::panko::authtoken (
$step = Integer(hiera('step')),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = pick($memcached_ips, $memcached_hosts)
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {
$hashed_secret_key = sha256("${secret_key}+zaqar")
$hashed_secret_key = sha256("${secret_key}+panko")
} else {
$hashed_secret_key = undef
}

View File

@ -31,6 +31,10 @@
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -50,18 +54,19 @@ class tripleo::profile::base::placement::authtoken (
$step = Integer(hiera('step')),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = pick($memcached_ips, $memcached_hosts)
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -16,19 +16,25 @@
#
# Zaqar authtoken profile for TripleO
#
# === Parameters
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
# Defaults to hiera('step')
#
# [*memcached_ips*]
# (Optional) Array of ipv4 or ipv6 addresses for memcache.
# Defaults to hiera('memcached_node_ips', [])
# [*memcached_hosts*]
# (Optional) Array of hostnames, ipv4 or ipv6 addresses for memcache.
# Defaults to hiera('memcached_node_names', [])
#
# [*memcached_port*]
# (Optional) Memcached port to use.
# Defaults to hiera('memcached_authtoken_port', 11211)
#
# [*memcached_ipv6*]
# (Optional) Whether Memcached uses IPv6 network instead of IPv4 network.
# Defauls to hiera('memcached_ipv6', false)
#
# [*security_strategy*]
# (Optional) Memcached (authtoken) security strategy.
# Defaults to hiera('memcached_authtoken_security_strategy', undef)
@ -38,19 +44,29 @@
# The key is hashed with a salt, to isolate services.
# Defaults to hiera('memcached_authtoken_secret_key', undef)
#
# DEPRECATED PARAMETERS
#
# [*memcached_ips*]
# (Optional) Array of ipv4 or ipv6 addresses for memcache.
# Defaults to undef
#
class tripleo::profile::base::zaqar::authtoken (
$step = Integer(hiera('step')),
$memcached_ips = hiera('memcached_node_ips', []),
$memcached_hosts = hiera('memcached_node_names', []),
$memcached_port = hiera('memcached_authtoken_port', 11211),
$memcached_ipv6 = hiera('memcached_ipv6', false),
$security_strategy = hiera('memcached_authtoken_security_strategy', undef),
$secret_key = hiera('memcached_authtoken_secret_key', undef),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
$memcached_hosts_real = any2array(pick($memcached_ips, $memcached_hosts))
if $step >= 3 {
if is_ipv6_address($memcached_ips[0]) {
$memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}"), 'inet6:')
if $memcached_ipv6 or is_ipv6_address($memcached_hosts_real[0]) {
$memcache_servers = $memcached_hosts_real.map |$server| { "inet6:[${server}]:${memcached_port}" }
} else {
$memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}")
$memcache_servers = suffix($memcached_hosts_real, ":${memcached_port}")
}
if $secret_key {

View File

@ -31,30 +31,46 @@ describe 'tripleo::profile::base::aodh::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::aodh::authtoken')
is_expected.to contain_class('aodh::keystone::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::aodh::authtoken')
is_expected.to contain_class('aodh::keystone::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::aodh::authtoken')
is_expected.to contain_class('aodh::keystone::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -31,30 +31,46 @@ describe 'tripleo::profile::base::barbican::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::barbican::authtoken')
is_expected.to contain_class('barbican::keystone::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::barbican::authtoken')
is_expected.to contain_class('barbican::keystone::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::barbican::authtoken')
is_expected.to contain_class('barbican::keystone::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -31,30 +31,46 @@ describe 'tripleo::profile::base::cinder::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::cinder::authtoken')
is_expected.to contain_class('cinder::keystone::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::cinder::authtoken')
is_expected.to contain_class('cinder::keystone::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::cinder::authtoken')
is_expected.to contain_class('cinder::keystone::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2020 Red Hat, Inc.
# Copyright (C) 2019 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
@ -31,30 +31,46 @@ describe 'tripleo::profile::base::designate::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::designate::authtoken')
is_expected.to contain_class('designate::keystone::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::designate::authtoken')
is_expected.to contain_class('designate::keystone::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::designate::authtoken')
is_expected.to contain_class('designate::keystone::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -31,30 +31,46 @@ describe 'tripleo::profile::base::glance::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::glance::authtoken')
is_expected.to contain_class('glance::api::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::glance::authtoken')
is_expected.to contain_class('glance::api::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::glance::authtoken')
is_expected.to contain_class('glance::api::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -31,30 +31,46 @@ describe 'tripleo::profile::base::gnocchi::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::gnocchi::authtoken')
is_expected.to contain_class('gnocchi::keystone::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::gnocchi::authtoken')
is_expected.to contain_class('gnocchi::keystone::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::gnocchi::authtoken')
is_expected.to contain_class('gnocchi::keystone::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -31,30 +31,46 @@ describe 'tripleo::profile::base::heat::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::heat::authtoken')
is_expected.to contain_class('heat::keystone::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::heat::authtoken')
is_expected.to contain_class('heat::keystone::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::heat::authtoken')
is_expected.to contain_class('heat::keystone::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -31,30 +31,46 @@ describe 'tripleo::profile::base::ironic::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::ironic::authtoken')
is_expected.to contain_class('ironic::api::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::ironic::authtoken')
is_expected.to contain_class('ironic::api::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::ironic::authtoken')
is_expected.to contain_class('ironic::api::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -31,30 +31,46 @@ describe 'tripleo::profile::base::ironic_inspector::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::ironic_inspector::authtoken')
is_expected.to contain_class('ironic::inspector::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::ironic_inspector::authtoken')
is_expected.to contain_class('ironic::inspector::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::ironic_inspector::authtoken')
is_expected.to contain_class('ironic::inspector::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -31,30 +31,46 @@ describe 'tripleo::profile::base::manila::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::manila::authtoken')
is_expected.to contain_class('manila::keystone::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::manila::authtoken')
is_expected.to contain_class('manila::keystone::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::manila::authtoken')
is_expected.to contain_class('manila::keystone::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -31,30 +31,46 @@ describe 'tripleo::profile::base::mistral::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:memcached_ips => '127.0.0.1',
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::mistral::authtoken')
is_expected.to contain_class('mistral::keystone::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:memcached_ips => '::1',
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::mistral::authtoken')
is_expected.to contain_class('mistral::keystone::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::mistral::authtoken')
is_expected.to contain_class('mistral::keystone::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -31,30 +31,46 @@ describe 'tripleo::profile::base::neutron::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::neutron::authtoken')
is_expected.to contain_class('neutron::keystone::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::neutron::authtoken')
is_expected.to contain_class('neutron::keystone::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::neutron::authtoken')
is_expected.to contain_class('neutron::keystone::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2017 Red Hat, Inc.
# Copyright (C) 2019 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
@ -31,30 +31,46 @@ describe 'tripleo::profile::base::nova::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::nova::authtoken')
is_expected.to contain_class('nova::keystone::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::nova::authtoken')
is_expected.to contain_class('nova::keystone::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::nova::authtoken')
is_expected.to contain_class('nova::keystone::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -31,30 +31,46 @@ describe 'tripleo::profile::base::novajoin::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:memcached_ips => '127.0.0.1',
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::novajoin::authtoken')
is_expected.to contain_class('nova::metadata::novajoin::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:memcached_ips => '::1',
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::novajoin::authtoken')
is_expected.to contain_class('nova::metadata::novajoin::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::novajoin::authtoken')
is_expected.to contain_class('nova::metadata::novajoin::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2017 Red Hat, Inc.
# Copyright (C) 2019 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
@ -31,30 +31,46 @@ describe 'tripleo::profile::base::octavia::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::octavia::authtoken')
is_expected.to contain_class('octavia::keystone::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::octavia::authtoken')
is_expected.to contain_class('octavia::keystone::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::octavia::authtoken')
is_expected.to contain_class('octavia::keystone::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -31,30 +31,46 @@ describe 'tripleo::profile::base::panko::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::panko::authtoken')
is_expected.to contain_class('panko::keystone::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::panko::authtoken')
is_expected.to contain_class('panko::keystone::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::panko::authtoken')
is_expected.to contain_class('panko::keystone::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end

View File

@ -31,30 +31,46 @@ describe 'tripleo::profile::base::zaqar::authtoken' do
context 'with step 3' do
let(:params) { {
:step => 3,
:memcached_ips => '127.0.0.1',
:step => 3,
:memcached_hosts => '127.0.0.1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::zaqar::authtoken')
is_expected.to contain_class('zaqar::keystone::authtoken').with(
:memcached_servers => ['127.0.0.1:11211'])
:memcached_servers => ['127.0.0.1:11211']
)
}
end
context 'with step 3 with ipv6' do
let(:params) { {
:step => 3,
:memcached_ips => '::1',
:step => 3,
:memcached_hosts => '::1',
} }
it {
is_expected.to contain_class('tripleo::profile::base::zaqar::authtoken')
is_expected.to contain_class('zaqar::keystone::authtoken').with(
:memcached_servers => ['[::1]:11211'])
:memcached_servers => ['inet6:[::1]:11211']
)
}
end
context 'with step 3 with the ipv6 parameter' do
let(:params) { {
:step => 3,
:memcached_hosts => 'node.example.com',
:memcached_ipv6 => true,
} }
it {
is_expected.to contain_class('tripleo::profile::base::zaqar::authtoken')
is_expected.to contain_class('zaqar::keystone::authtoken').with(
:memcached_servers => ['inet6:[node.example.com]:11211']
)
}
end
end