Merge "Format [keystone_authtoken] memcache_servers when IPv6 is used" into stable/victoria

This commit is contained in:
Zuul 2022-04-07 23:56:04 +00:00 committed by Gerrit Code Review
commit 64d213e6cf
35 changed files with 496 additions and 209 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

@ -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::mistral::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::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

@ -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::novajoin::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::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,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

@ -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::zaqar::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,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,
: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,
: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,
: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,
: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::placement::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::placement::authtoken')
is_expected.to contain_class('placement::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::placement::authtoken')
is_expected.to contain_class('placement::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::placement::authtoken')
is_expected.to contain_class('placement::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,
: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,
: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

View File

@ -1,70 +0,0 @@
#
# Copyright (C) 2020 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
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
require 'spec_helper'
describe 'tripleo::profile::base::zaqar::authtoken' do
shared_examples_for 'tripleo::profile::base::zaqar::authtoken' do
context 'with step less than 3' do
let(:params) { {
:step => 1,
} }
it {
is_expected.to contain_class('tripleo::profile::base::zaqar::authtoken')
is_expected.to_not contain_class('zaqar::keystone::authtoken')
}
end
context 'with step 3' do
let(:params) { {
: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'])
}
end
context 'with step 3 with ipv6' do
let(:params) { {
: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'])
}
end
end
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge({ :hostname => 'node.example.com' })
end
it_behaves_like 'tripleo::profile::base::zaqar::authtoken'
end
end
end