diff --git a/manifests/profile/base/aodh/authtoken.pp b/manifests/profile/base/aodh/authtoken.pp index 369be0238..7cf5e2a8f 100644 --- a/manifests/profile/base/aodh/authtoken.pp +++ b/manifests/profile/base/aodh/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/barbican/authtoken.pp b/manifests/profile/base/barbican/authtoken.pp index debbedfdf..14c03aef0 100644 --- a/manifests/profile/base/barbican/authtoken.pp +++ b/manifests/profile/base/barbican/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/cinder/authtoken.pp b/manifests/profile/base/cinder/authtoken.pp index caf52a950..682415ec4 100644 --- a/manifests/profile/base/cinder/authtoken.pp +++ b/manifests/profile/base/cinder/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/designate/authtoken.pp b/manifests/profile/base/designate/authtoken.pp index c5a6cedfd..6c7642953 100644 --- a/manifests/profile/base/designate/authtoken.pp +++ b/manifests/profile/base/designate/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/glance/authtoken.pp b/manifests/profile/base/glance/authtoken.pp index 12938a057..e138bd76f 100644 --- a/manifests/profile/base/glance/authtoken.pp +++ b/manifests/profile/base/glance/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/gnocchi/authtoken.pp b/manifests/profile/base/gnocchi/authtoken.pp index e68a15bc8..7f4bb2db9 100644 --- a/manifests/profile/base/gnocchi/authtoken.pp +++ b/manifests/profile/base/gnocchi/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/heat/authtoken.pp b/manifests/profile/base/heat/authtoken.pp index fa7d68f75..11f975312 100644 --- a/manifests/profile/base/heat/authtoken.pp +++ b/manifests/profile/base/heat/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/ironic/authtoken.pp b/manifests/profile/base/ironic/authtoken.pp index de3d5307f..3f650e927 100644 --- a/manifests/profile/base/ironic/authtoken.pp +++ b/manifests/profile/base/ironic/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/ironic_inspector/authtoken.pp b/manifests/profile/base/ironic_inspector/authtoken.pp index d68687a1c..d0d3842c3 100644 --- a/manifests/profile/base/ironic_inspector/authtoken.pp +++ b/manifests/profile/base/ironic_inspector/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/manila/authtoken.pp b/manifests/profile/base/manila/authtoken.pp index e12e2128b..b32614e5a 100644 --- a/manifests/profile/base/manila/authtoken.pp +++ b/manifests/profile/base/manila/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/mistral/authtoken.pp b/manifests/profile/base/mistral/authtoken.pp index aa9751620..da77a13d0 100644 --- a/manifests/profile/base/mistral/authtoken.pp +++ b/manifests/profile/base/mistral/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/neutron/authtoken.pp b/manifests/profile/base/neutron/authtoken.pp index ace0009b8..ea5ed2d15 100644 --- a/manifests/profile/base/neutron/authtoken.pp +++ b/manifests/profile/base/neutron/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/nova/authtoken.pp b/manifests/profile/base/nova/authtoken.pp index 759727f02..c3aa49b50 100644 --- a/manifests/profile/base/nova/authtoken.pp +++ b/manifests/profile/base/nova/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/novajoin/authtoken.pp b/manifests/profile/base/novajoin/authtoken.pp index 60f6b6391..3cbf4de8c 100644 --- a/manifests/profile/base/novajoin/authtoken.pp +++ b/manifests/profile/base/novajoin/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/octavia/authtoken.pp b/manifests/profile/base/octavia/authtoken.pp index ae0d2cae8..65ae627ec 100644 --- a/manifests/profile/base/octavia/authtoken.pp +++ b/manifests/profile/base/octavia/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/panko/authtoken.pp b/manifests/profile/base/panko/authtoken.pp index 83ae10dbb..9c946f05b 100644 --- a/manifests/profile/base/panko/authtoken.pp +++ b/manifests/profile/base/panko/authtoken.pp @@ -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 } diff --git a/manifests/profile/base/placement/authtoken.pp b/manifests/profile/base/placement/authtoken.pp index 5a0668550..64f716ea6 100644 --- a/manifests/profile/base/placement/authtoken.pp +++ b/manifests/profile/base/placement/authtoken.pp @@ -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 { diff --git a/manifests/profile/base/zaqar/authtoken.pp b/manifests/profile/base/zaqar/authtoken.pp index 6b5467dd0..03b71be73 100644 --- a/manifests/profile/base/zaqar/authtoken.pp +++ b/manifests/profile/base/zaqar/authtoken.pp @@ -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 { diff --git a/spec/classes/tripleo_profile_base_aodh_authtoken_spec.rb b/spec/classes/tripleo_profile_base_aodh_authtoken_spec.rb index 6a12f321d..829c2d011 100644 --- a/spec/classes/tripleo_profile_base_aodh_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_aodh_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_base_barbican_authtoken_spec.rb b/spec/classes/tripleo_profile_base_barbican_authtoken_spec.rb index 3cbbf0d3e..2080a9196 100644 --- a/spec/classes/tripleo_profile_base_barbican_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_barbican_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_base_cinder_authtoken_spec.rb b/spec/classes/tripleo_profile_base_cinder_authtoken_spec.rb index a4e8262a7..15215a4cd 100644 --- a/spec/classes/tripleo_profile_base_cinder_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_cinder_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_base_designate_authtoken_spec.rb b/spec/classes/tripleo_profile_base_designate_authtoken_spec.rb index b70bfb531..3a6373829 100644 --- a/spec/classes/tripleo_profile_base_designate_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_designate_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_base_glance_authtoken_spec.rb b/spec/classes/tripleo_profile_base_glance_authtoken_spec.rb index bb0aa1ac1..f6c742416 100644 --- a/spec/classes/tripleo_profile_base_glance_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_glance_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_base_gnocchi_authtoken_spec.rb b/spec/classes/tripleo_profile_base_gnocchi_authtoken_spec.rb index 02651aa44..f76bfc05d 100644 --- a/spec/classes/tripleo_profile_base_gnocchi_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_gnocchi_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_base_heat_authtoken_spec.rb b/spec/classes/tripleo_profile_base_heat_authtoken_spec.rb index 78b0106dc..9712b8fd8 100644 --- a/spec/classes/tripleo_profile_base_heat_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_heat_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_base_ironic_authtoken_spec.rb b/spec/classes/tripleo_profile_base_ironic_authtoken_spec.rb index 16ff3d1d1..154cb5ad9 100644 --- a/spec/classes/tripleo_profile_base_ironic_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_ironic_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_base_ironic_inspector_authtoken_spec.rb b/spec/classes/tripleo_profile_base_ironic_inspector_authtoken_spec.rb index 5b8c43075..fbb9b2b63 100644 --- a/spec/classes/tripleo_profile_base_ironic_inspector_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_ironic_inspector_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_base_manila_authtoken_spec.rb b/spec/classes/tripleo_profile_base_manila_authtoken_spec.rb index e609a2648..525c838b0 100644 --- a/spec/classes/tripleo_profile_base_manila_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_manila_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_base_mistral_authtoken_spec.rb b/spec/classes/tripleo_profile_base_mistral_authtoken_spec.rb index 46ee1f1e8..8a09c3000 100644 --- a/spec/classes/tripleo_profile_base_mistral_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_mistral_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_base_neutron_authtoken_spec.rb b/spec/classes/tripleo_profile_base_neutron_authtoken_spec.rb index 31dfcf071..edb0696e6 100644 --- a/spec/classes/tripleo_profile_base_neutron_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_neutron_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_base_nova_authtoken_spec.rb b/spec/classes/tripleo_profile_base_nova_authtoken_spec.rb index 3bc1f66f0..1f5052f5c 100644 --- a/spec/classes/tripleo_profile_base_nova_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_nova_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_base_novajoin_authtoken_spec.rb b/spec/classes/tripleo_profile_base_novajoin_authtoken_spec.rb index 791114de0..c28b1ef6f 100644 --- a/spec/classes/tripleo_profile_base_novajoin_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_novajoin_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_base_octavia_authtoken_spec.rb b/spec/classes/tripleo_profile_base_octavia_authtoken_spec.rb index a5b490912..de0747944 100644 --- a/spec/classes/tripleo_profile_base_octavia_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_octavia_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_base_panko_authtoken_spec.rb b/spec/classes/tripleo_profile_base_panko_authtoken_spec.rb index 15a27e99c..415a511fc 100644 --- a/spec/classes/tripleo_profile_base_panko_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_panko_authtoken_spec.rb @@ -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 diff --git a/spec/classes/tripleo_profile_zaqar_authtoken_spec.rb b/spec/classes/tripleo_profile_base_zaqar_authtoken_spec.rb similarity index 70% rename from spec/classes/tripleo_profile_zaqar_authtoken_spec.rb rename to spec/classes/tripleo_profile_base_zaqar_authtoken_spec.rb index e45def965..6ae12efdf 100644 --- a/spec/classes/tripleo_profile_zaqar_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_zaqar_authtoken_spec.rb @@ -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