From 057fbbdb90f9f4a5472f4be2a8c892a1c4551b35 Mon Sep 17 00:00:00 2001 From: Grzegorz Grasza Date: Thu, 17 Jun 2021 14:35:52 +0200 Subject: [PATCH] Set memcached server list from memcached_node_names This follows other clustered services (like RabbitMQ) and uses *_node_names (which contain FQDNs), instead of *_node_ips. Certificate for Memcached TLS is also created using FQDN. Because of this, validation failed when using pymemcache. This patch fixes this issue. Closes-Bug: #1929574 Change-Id: I9d0ddcc88098a5b891829192f1ce656842d0aa15 (cherry picked from commit 49921d57f5753dffe032b9501d1101707ce8cc1e) --- manifests/profile/base/aodh/authtoken.pp | 25 ++++++++++++----- manifests/profile/base/barbican/authtoken.pp | 27 +++++++++++++------ manifests/profile/base/cinder/authtoken.pp | 25 ++++++++++++----- manifests/profile/base/designate/authtoken.pp | 25 ++++++++++++----- manifests/profile/base/glance/authtoken.pp | 25 ++++++++++++----- manifests/profile/base/gnocchi/authtoken.pp | 25 ++++++++++++----- manifests/profile/base/heat.pp | 24 +++++++++++++---- manifests/profile/base/heat/authtoken.pp | 25 ++++++++++++----- manifests/profile/base/horizon.pp | 21 ++++++++++----- manifests/profile/base/ironic/authtoken.pp | 25 ++++++++++++----- .../base/ironic_inspector/authtoken.pp | 25 ++++++++++++----- manifests/profile/base/keystone.pp | 20 ++++++++++---- manifests/profile/base/manila/authtoken.pp | 25 ++++++++++++----- manifests/profile/base/neutron/authtoken.pp | 25 ++++++++++++----- manifests/profile/base/nova.pp | 23 +++++++++++----- manifests/profile/base/nova/authtoken.pp | 25 ++++++++++++----- manifests/profile/base/octavia/authtoken.pp | 25 ++++++++++++----- manifests/profile/base/panko/authtoken.pp | 25 ++++++++++++----- manifests/profile/base/placement/authtoken.pp | 25 ++++++++++++----- manifests/profile/base/swift/proxy.pp | 4 +-- ...ripleo_profile_base_aodh_authtoken_spec.rb | 4 +-- ...eo_profile_base_barbican_authtoken_spec.rb | 4 +-- ...pleo_profile_base_cinder_authtoken_spec.rb | 4 +-- ...o_profile_base_designate_authtoken_spec.rb | 4 +-- ...pleo_profile_base_glance_authtoken_spec.rb | 4 +-- ...leo_profile_base_gnocchi_authtoken_spec.rb | 4 +-- ...ripleo_profile_base_heat_authtoken_spec.rb | 4 +-- .../classes/tripleo_profile_base_heat_spec.rb | 6 ++--- ...pleo_profile_base_ironic_authtoken_spec.rb | 4 +-- ...le_base_ironic_inspector_authtoken_spec.rb | 4 +-- .../tripleo_profile_base_keystone_spec.rb | 2 +- ...pleo_profile_base_manila_authtoken_spec.rb | 4 +-- ...leo_profile_base_neutron_authtoken_spec.rb | 4 +-- ...ripleo_profile_base_nova_authtoken_spec.rb | 4 +-- .../classes/tripleo_profile_base_nova_spec.rb | 2 +- ...leo_profile_base_octavia_authtoken_spec.rb | 4 +-- ...ipleo_profile_base_panko_authtoken_spec.rb | 4 +-- spec/fixtures/hieradata/default.yaml | 6 ++--- 38 files changed, 373 insertions(+), 168 deletions(-) diff --git a/manifests/profile/base/aodh/authtoken.pp b/manifests/profile/base/aodh/authtoken.pp index 463e37e39..369be0238 100644 --- a/manifests/profile/base/aodh/authtoken.pp +++ b/manifests/profile/base/aodh/authtoken.pp @@ -16,14 +16,16 @@ # # Aodh 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. @@ -38,19 +40,28 @@ # 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::aodh::authtoken ( $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_authtoken_port', 11211), $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) 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 is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($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 9b0c39a62..debbedfdf 100644 --- a/manifests/profile/base/barbican/authtoken.pp +++ b/manifests/profile/base/barbican/authtoken.pp @@ -16,18 +16,20 @@ # # Barbican 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', []) +# Defaults to hiera('memcached_authtoken_port', 11211) # # [*security_strategy*] # (Optional) Memcached (authtoken) security strategy. @@ -38,19 +40,28 @@ # 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::barbican::authtoken ( $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_authtoken_port', 11211), $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) 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 is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($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 e737d7d91..caf52a950 100644 --- a/manifests/profile/base/cinder/authtoken.pp +++ b/manifests/profile/base/cinder/authtoken.pp @@ -16,14 +16,16 @@ # # Cinder 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. @@ -38,19 +40,28 @@ # 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::cinder::authtoken ( $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_authtoken_port', 11211), $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) 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 is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($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 94a300b6f..c5a6cedfd 100644 --- a/manifests/profile/base/designate/authtoken.pp +++ b/manifests/profile/base/designate/authtoken.pp @@ -16,14 +16,16 @@ # # Designate 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. @@ -38,19 +40,28 @@ # 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::designate::authtoken ( $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_authtoken_port', 11211), $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) 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 is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($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 bc8584c90..12938a057 100644 --- a/manifests/profile/base/glance/authtoken.pp +++ b/manifests/profile/base/glance/authtoken.pp @@ -16,14 +16,16 @@ # # Glance 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. @@ -38,19 +40,28 @@ # 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::glance::authtoken ( $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_authtoken_port', 11211), $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) 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 is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($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 e20abc165..e68a15bc8 100644 --- a/manifests/profile/base/gnocchi/authtoken.pp +++ b/manifests/profile/base/gnocchi/authtoken.pp @@ -16,14 +16,16 @@ # # Gnocchi 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. @@ -38,19 +40,28 @@ # 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::gnocchi::authtoken ( $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_authtoken_port', 11211), $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) 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 is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}") } if $secret_key { diff --git a/manifests/profile/base/heat.pp b/manifests/profile/base/heat.pp index 55beec099..e0a646c5b 100644 --- a/manifests/profile/base/heat.pp +++ b/manifests/profile/base/heat.pp @@ -79,9 +79,19 @@ # Enable ssl oslo messaging services # Defaults to hiera('oslo_messaging_notify_use_ssl', '0') # +# [*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_port', 11211) +# +# DEPRECATED PARAMETERS +# # [*memcached_ips*] # (Optional) Array of ipv4 or ipv6 addresses for memcache. -# Defaults to hiera('memcached_node_ips') +# Defaults to undef # class tripleo::profile::base::heat ( $bootstrap_node = downcase(hiera('heat_engine_short_bootstrap_node_name')), @@ -99,8 +109,12 @@ class tripleo::profile::base::heat ( $oslomsg_notify_port = hiera('oslo_messaging_notify_port', '5672'), $oslomsg_notify_username = hiera('oslo_messaging_notify_user_name', 'guest'), $oslomsg_notify_use_ssl = hiera('oslo_messaging_notify_use_ssl', '0'), - $memcached_ips = hiera('memcached_node_ips'), + $memcached_hosts = hiera('memcached_node_names', []), + $memcached_port = hiera('memcached_port', 11211), + # DEPRECATED PARAMETERS + $memcached_ips = undef ) { + $memcached_hosts_real = pick($memcached_ips, $memcached_hosts) include ::tripleo::profile::base::heat::authtoken @@ -137,10 +151,10 @@ class tripleo::profile::base::heat ( include ::heat::cors include ::heat::logging - if is_ipv6_address($memcached_ips[0]) { - $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_ips)), ':11211'), 'inet6:') + if is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ':11211') + $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}") } class { '::heat::cache': diff --git a/manifests/profile/base/heat/authtoken.pp b/manifests/profile/base/heat/authtoken.pp index 784a0c95d..fa7d68f75 100644 --- a/manifests/profile/base/heat/authtoken.pp +++ b/manifests/profile/base/heat/authtoken.pp @@ -16,14 +16,16 @@ # # Heat 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. @@ -38,19 +40,28 @@ # 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::heat::authtoken ( $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_authtoken_port', 11211), $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) 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 is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}") } if $secret_key { diff --git a/manifests/profile/base/horizon.pp b/manifests/profile/base/horizon.pp index aacf7b222..7c48ac35d 100644 --- a/manifests/profile/base/horizon.pp +++ b/manifests/profile/base/horizon.pp @@ -52,9 +52,15 @@ # (Optional) A hash of parameters to enable features specific to Neutron # Defaults to hiera('horizon::neutron_options', {}) # +# [*memcached_hosts*] +# (Optional) Array of hostnames, ipv4 or ipv6 addresses for memcache. +# Defaults to hiera('memcached_node_names', []) +# +# DEPRECATED PARAMETERS +# # [*memcached_ips*] # (Optional) Array of ipv4 or ipv6 addresses for memcache. -# Defaults to hiera('memcached_node_ips') +# Defaults to undef # class tripleo::profile::base::horizon ( $step = Integer(hiera('step')), @@ -63,8 +69,12 @@ class tripleo::profile::base::horizon ( $enable_internal_tls = hiera('enable_internal_tls', false), $horizon_network = hiera('horizon_network', undef), $neutron_options = hiera('horizon::neutron_options', {}), - $memcached_ips = hiera('memcached_node_ips') + $memcached_hosts = hiera('memcached_node_names', []), + # DEPRECATED PARAMETERS + $memcached_ips = undef ) { + $memcached_hosts_real = pick($memcached_ips, $memcached_hosts) + if $bootstrap_node and $::hostname == downcase($bootstrap_node) { $is_bootstrap = true } else { @@ -94,11 +104,10 @@ class tripleo::profile::base::horizon ( } $neutron_options_real = merge({'profile_support' => $_profile_support }, $neutron_options) - if is_ipv6_address($memcached_ips[0]) { - $horizon_memcached_servers = prefix(any2array(normalize_ip_for_uri($memcached_ips)), 'inet6:') - + if is_ipv6_address($memcached_hosts_real[0]) { + $horizon_memcached_servers = prefix(any2array(normalize_ip_for_uri($memcached_hosts_real)), 'inet6:') } else { - $horizon_memcached_servers = any2array(normalize_ip_for_uri($memcached_ips)) + $horizon_memcached_servers = any2array(normalize_ip_for_uri($memcached_hosts_real)) } class { '::horizon': diff --git a/manifests/profile/base/ironic/authtoken.pp b/manifests/profile/base/ironic/authtoken.pp index 0a2c9cc9d..de3d5307f 100644 --- a/manifests/profile/base/ironic/authtoken.pp +++ b/manifests/profile/base/ironic/authtoken.pp @@ -16,14 +16,16 @@ # # Ironic 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. @@ -38,19 +40,28 @@ # 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::ironic::authtoken ( $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_authtoken_port', 11211), $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) 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 is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($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 42cbf8278..d68687a1c 100644 --- a/manifests/profile/base/ironic_inspector/authtoken.pp +++ b/manifests/profile/base/ironic_inspector/authtoken.pp @@ -16,14 +16,16 @@ # # Ironic inspector 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. @@ -38,19 +40,28 @@ # 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::ironic_inspector::authtoken ( $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_authtoken_port', 11211), $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) 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 is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}") } if $secret_key { diff --git a/manifests/profile/base/keystone.pp b/manifests/profile/base/keystone.pp index ed6c6edb3..46666b7aa 100644 --- a/manifests/profile/base/keystone.pp +++ b/manifests/profile/base/keystone.pp @@ -154,9 +154,9 @@ # (Optional) Enable OpenIDC federation # Defaults to hiera('keystone_openidc_enabled', false) # -# [*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. @@ -169,6 +169,12 @@ # assignment. # Defaults to hiera('keystone_resources_managed', true) # +# DEPRECATED PARAMETERS +# +# [*memcached_ips*] +# (Optional) Array of ipv4 or ipv6 addresses for memcache. +# Defaults to undef +# class tripleo::profile::base::keystone ( $admin_endpoint_network = hiera('keystone_admin_api_network', undef), $bootstrap_node = hiera('keystone_short_bootstrap_node_name', undef), @@ -201,10 +207,14 @@ class tripleo::profile::base::keystone ( $keystone_enable_member = hiera('keystone_enable_member', false), $keystone_federation_enabled = hiera('keystone_federation_enabled', false), $keystone_openidc_enabled = hiera('keystone_openidc_enabled', false), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_port', 11211), $keystone_resources_managed = hiera('keystone_resources_managed', true), + # DEPRECATED PARAMETERS + $memcached_ips = undef ) { + $memcached_hosts_real = pick($memcached_ips, $memcached_hosts) + if $bootstrap_node and $::hostname == downcase($bootstrap_node) and $keystone_resources_managed { $sync_db = true $manage_roles = true @@ -235,7 +245,7 @@ class tripleo::profile::base::keystone ( if $step >= 4 or ( $step >= 3 and $sync_db ) { $oslomsg_rpc_use_ssl_real = sprintf('%s', bool2num(str2bool($oslomsg_rpc_use_ssl))) $oslomsg_notify_use_ssl_real = sprintf('%s', bool2num(str2bool($oslomsg_notify_use_ssl))) - $memcached_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcached_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}") class { '::keystone': sync_db => $sync_db, diff --git a/manifests/profile/base/manila/authtoken.pp b/manifests/profile/base/manila/authtoken.pp index b4874c503..e12e2128b 100644 --- a/manifests/profile/base/manila/authtoken.pp +++ b/manifests/profile/base/manila/authtoken.pp @@ -16,14 +16,16 @@ # # Manila 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. @@ -38,19 +40,28 @@ # 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::manila::authtoken ( $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_authtoken_port', 11211), $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) 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 is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($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 528e2c099..ace0009b8 100644 --- a/manifests/profile/base/neutron/authtoken.pp +++ b/manifests/profile/base/neutron/authtoken.pp @@ -16,14 +16,16 @@ # # Neutron 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. @@ -38,19 +40,28 @@ # 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::neutron::authtoken ( $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_authtoken_port', 11211), $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) 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 is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}") } if $secret_key { diff --git a/manifests/profile/base/nova.pp b/manifests/profile/base/nova.pp index d8638e59e..e23999a8e 100644 --- a/manifests/profile/base/nova.pp +++ b/manifests/profile/base/nova.pp @@ -74,14 +74,20 @@ # (Optional) The current step of the deployment # 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_port', 11211) # +# DEPRECATED PARAMETERS +# +# [*memcached_ips*] +# (Optional) Array of ipv4 or ipv6 addresses for memcache. +# Defaults to undef +# class tripleo::profile::base::nova ( $bootstrap_node = hiera('nova_api_short_bootstrap_node_name', undef), $oslomsg_rpc_proto = hiera('oslo_messaging_rpc_scheme', 'rabbit'), @@ -97,9 +103,12 @@ class tripleo::profile::base::nova ( $oslomsg_notify_username = hiera('oslo_messaging_notify_user_name', 'guest'), $oslomsg_notify_use_ssl = hiera('oslo_messaging_notify_use_ssl', '0'), $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips'), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_port', 11211), + # DEPRECATED PARAMETERS + $memcached_ips = undef ) { + $memcached_hosts_real = pick($memcached_ips, $memcached_hosts) if $bootstrap_node and $::hostname == downcase($bootstrap_node) { $sync_db = true @@ -107,10 +116,10 @@ class tripleo::profile::base::nova ( $sync_db = false } - if is_ipv6_address($memcached_ips[0]) { - $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}"), 'inet6:') + if is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}") } if $step >= 4 or ($step >= 3 and $sync_db) { diff --git a/manifests/profile/base/nova/authtoken.pp b/manifests/profile/base/nova/authtoken.pp index 06f24ae01..759727f02 100644 --- a/manifests/profile/base/nova/authtoken.pp +++ b/manifests/profile/base/nova/authtoken.pp @@ -16,14 +16,16 @@ # # Nova 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. @@ -38,19 +40,28 @@ # 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::nova::authtoken ( $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_authtoken_port', 11211), $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) 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 is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($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 52ef7cd4a..ae0d2cae8 100644 --- a/manifests/profile/base/octavia/authtoken.pp +++ b/manifests/profile/base/octavia/authtoken.pp @@ -16,14 +16,16 @@ # # Octavia 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. @@ -38,19 +40,28 @@ # 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::octavia::authtoken ( $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_authtoken_port', 11211), $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) 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 is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($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 3e58fdcff..83ae10dbb 100644 --- a/manifests/profile/base/panko/authtoken.pp +++ b/manifests/profile/base/panko/authtoken.pp @@ -16,14 +16,16 @@ # # Panko 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. @@ -38,19 +40,28 @@ # 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::panko::authtoken ( $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_authtoken_port', 11211), $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) 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 is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}") } if $secret_key { diff --git a/manifests/profile/base/placement/authtoken.pp b/manifests/profile/base/placement/authtoken.pp index 4704d97dd..5a0668550 100644 --- a/manifests/profile/base/placement/authtoken.pp +++ b/manifests/profile/base/placement/authtoken.pp @@ -16,14 +16,16 @@ # # Placement 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. @@ -38,19 +40,28 @@ # 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::placement::authtoken ( $step = Integer(hiera('step')), - $memcached_ips = hiera('memcached_node_ips', []), + $memcached_hosts = hiera('memcached_node_names', []), $memcached_port = hiera('memcached_authtoken_port', 11211), $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) 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 is_ipv6_address($memcached_hosts_real[0]) { + $memcache_servers = prefix(suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}"), 'inet6:') } else { - $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ":${memcached_port}") + $memcache_servers = suffix(any2array(normalize_ip_for_uri($memcached_hosts_real)), ":${memcached_port}") } if $secret_key { diff --git a/manifests/profile/base/swift/proxy.pp b/manifests/profile/base/swift/proxy.pp index adfe50ed6..6a1212dd4 100644 --- a/manifests/profile/base/swift/proxy.pp +++ b/manifests/profile/base/swift/proxy.pp @@ -72,7 +72,7 @@ # # [*memcache_servers*] # (Optional) List of memcache servers -# Defaults to hiera('memcached_node_ips') +# Defaults to hiera('memcached_node_names', []) # # [*step*] # (Optional) The current step in deployment. See tripleo-heat-templates @@ -111,7 +111,7 @@ class tripleo::profile::base::swift::proxy ( $certificates_specs = hiera('apache_certificates_specs', {}), $enable_internal_tls = hiera('enable_internal_tls', false), $memcache_port = hiera('memcached_port', 11211), - $memcache_servers = hiera('memcached_node_ips', []), + $memcache_servers = hiera('memcached_node_names', []), $step = Integer(hiera('step')), $swift_proxy_network = hiera('swift_proxy_network', undef), $tls_proxy_bind_ip = undef, diff --git a/spec/classes/tripleo_profile_base_aodh_authtoken_spec.rb b/spec/classes/tripleo_profile_base_aodh_authtoken_spec.rb index 000e1bd80..6a12f321d 100644 --- a/spec/classes/tripleo_profile_base_aodh_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_aodh_authtoken_spec.rb @@ -32,7 +32,7 @@ describe 'tripleo::profile::base::aodh::authtoken' do context 'with step 3' do let(:params) { { :step => 3, - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it { @@ -45,7 +45,7 @@ describe 'tripleo::profile::base::aodh::authtoken' do context 'with step 3 with ipv6' do let(:params) { { :step => 3, - :memcached_ips => '::1', + :memcached_hosts => '::1', } } it { diff --git a/spec/classes/tripleo_profile_base_barbican_authtoken_spec.rb b/spec/classes/tripleo_profile_base_barbican_authtoken_spec.rb index 523f8524f..3cbbf0d3e 100644 --- a/spec/classes/tripleo_profile_base_barbican_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_barbican_authtoken_spec.rb @@ -32,7 +32,7 @@ describe 'tripleo::profile::base::barbican::authtoken' do context 'with step 3' do let(:params) { { :step => 3, - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it { @@ -45,7 +45,7 @@ describe 'tripleo::profile::base::barbican::authtoken' do context 'with step 3 with ipv6' do let(:params) { { :step => 3, - :memcached_ips => '::1', + :memcached_hosts => '::1', } } it { diff --git a/spec/classes/tripleo_profile_base_cinder_authtoken_spec.rb b/spec/classes/tripleo_profile_base_cinder_authtoken_spec.rb index 3f0c47b8b..a4e8262a7 100644 --- a/spec/classes/tripleo_profile_base_cinder_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_cinder_authtoken_spec.rb @@ -32,7 +32,7 @@ describe 'tripleo::profile::base::cinder::authtoken' do context 'with step 3' do let(:params) { { :step => 3, - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it { @@ -45,7 +45,7 @@ describe 'tripleo::profile::base::cinder::authtoken' do context 'with step 3 with ipv6' do let(:params) { { :step => 3, - :memcached_ips => '::1', + :memcached_hosts => '::1', } } it { diff --git a/spec/classes/tripleo_profile_base_designate_authtoken_spec.rb b/spec/classes/tripleo_profile_base_designate_authtoken_spec.rb index a647eeb15..b70bfb531 100644 --- a/spec/classes/tripleo_profile_base_designate_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_designate_authtoken_spec.rb @@ -32,7 +32,7 @@ describe 'tripleo::profile::base::designate::authtoken' do context 'with step 3' do let(:params) { { :step => 3, - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it { @@ -45,7 +45,7 @@ describe 'tripleo::profile::base::designate::authtoken' do context 'with step 3 with ipv6' do let(:params) { { :step => 3, - :memcached_ips => '::1', + :memcached_hosts => '::1', } } it { diff --git a/spec/classes/tripleo_profile_base_glance_authtoken_spec.rb b/spec/classes/tripleo_profile_base_glance_authtoken_spec.rb index 5f4ddf660..bb0aa1ac1 100644 --- a/spec/classes/tripleo_profile_base_glance_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_glance_authtoken_spec.rb @@ -32,7 +32,7 @@ describe 'tripleo::profile::base::glance::authtoken' do context 'with step 3' do let(:params) { { :step => 3, - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it { @@ -45,7 +45,7 @@ describe 'tripleo::profile::base::glance::authtoken' do context 'with step 3 with ipv6' do let(:params) { { :step => 3, - :memcached_ips => '::1', + :memcached_hosts => '::1', } } it { diff --git a/spec/classes/tripleo_profile_base_gnocchi_authtoken_spec.rb b/spec/classes/tripleo_profile_base_gnocchi_authtoken_spec.rb index 4198a88c0..02651aa44 100644 --- a/spec/classes/tripleo_profile_base_gnocchi_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_gnocchi_authtoken_spec.rb @@ -32,7 +32,7 @@ describe 'tripleo::profile::base::gnocchi::authtoken' do context 'with step 3' do let(:params) { { :step => 3, - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it { @@ -45,7 +45,7 @@ describe 'tripleo::profile::base::gnocchi::authtoken' do context 'with step 3 with ipv6' do let(:params) { { :step => 3, - :memcached_ips => '::1', + :memcached_hosts => '::1', } } it { diff --git a/spec/classes/tripleo_profile_base_heat_authtoken_spec.rb b/spec/classes/tripleo_profile_base_heat_authtoken_spec.rb index 73c26cb2d..78b0106dc 100644 --- a/spec/classes/tripleo_profile_base_heat_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_heat_authtoken_spec.rb @@ -32,7 +32,7 @@ describe 'tripleo::profile::base::heat::authtoken' do context 'with step 3' do let(:params) { { :step => 3, - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it { @@ -45,7 +45,7 @@ describe 'tripleo::profile::base::heat::authtoken' do context 'with step 3 with ipv6' do let(:params) { { :step => 3, - :memcached_ips => '::1', + :memcached_hosts => '::1', } } it { diff --git a/spec/classes/tripleo_profile_base_heat_spec.rb b/spec/classes/tripleo_profile_base_heat_spec.rb index 82123ba74..0c9ce5806 100644 --- a/spec/classes/tripleo_profile_base_heat_spec.rb +++ b/spec/classes/tripleo_profile_base_heat_spec.rb @@ -53,7 +53,7 @@ eos :oslomsg_notify_username => 'heat2', :oslomsg_notify_password => 'baa', :oslomsg_notify_port => '5678', - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it 'should trigger complete configuration without db_purge' do @@ -89,7 +89,7 @@ eos :oslomsg_notify_username => 'heat2', :oslomsg_notify_password => 'baa', :oslomsg_notify_port => '5678', - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it 'should trigger complete configuration' do @@ -128,7 +128,7 @@ eos :oslomsg_notify_password => 'baa', :oslomsg_notify_port => '5678', :manage_db_purge => false, - :memcached_ips => '::1', + :memcached_hosts => '::1', } } it 'should trigger complete configuration without db_purge' do diff --git a/spec/classes/tripleo_profile_base_ironic_authtoken_spec.rb b/spec/classes/tripleo_profile_base_ironic_authtoken_spec.rb index f8bce4a72..16ff3d1d1 100644 --- a/spec/classes/tripleo_profile_base_ironic_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_ironic_authtoken_spec.rb @@ -32,7 +32,7 @@ describe 'tripleo::profile::base::ironic::authtoken' do context 'with step 3' do let(:params) { { :step => 3, - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it { @@ -45,7 +45,7 @@ describe 'tripleo::profile::base::ironic::authtoken' do context 'with step 3 with ipv6' do let(:params) { { :step => 3, - :memcached_ips => '::1', + :memcached_hosts => '::1', } } it { 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 8b43969b3..5b8c43075 100644 --- a/spec/classes/tripleo_profile_base_ironic_inspector_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_ironic_inspector_authtoken_spec.rb @@ -32,7 +32,7 @@ describe 'tripleo::profile::base::ironic_inspector::authtoken' do context 'with step 3' do let(:params) { { :step => 3, - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it { @@ -45,7 +45,7 @@ describe 'tripleo::profile::base::ironic_inspector::authtoken' do context 'with step 3 with ipv6' do let(:params) { { :step => 3, - :memcached_ips => '::1', + :memcached_hosts => '::1', } } it { diff --git a/spec/classes/tripleo_profile_base_keystone_spec.rb b/spec/classes/tripleo_profile_base_keystone_spec.rb index 18b0496ef..c436aa678 100644 --- a/spec/classes/tripleo_profile_base_keystone_spec.rb +++ b/spec/classes/tripleo_profile_base_keystone_spec.rb @@ -30,7 +30,7 @@ describe 'tripleo::profile::base::keystone' do :oslomsg_notify_username => 'keystone2', :oslomsg_notify_password => 'baa', :oslomsg_notify_port => '5678', - :memcached_ips => [ '192.168.0.3', '192.168.0.4', '192.168.0.5' ], + :memcached_hosts => [ '192.168.0.3', '192.168.0.4', '192.168.0.5' ], } end diff --git a/spec/classes/tripleo_profile_base_manila_authtoken_spec.rb b/spec/classes/tripleo_profile_base_manila_authtoken_spec.rb index 5f3a8a315..e609a2648 100644 --- a/spec/classes/tripleo_profile_base_manila_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_manila_authtoken_spec.rb @@ -32,7 +32,7 @@ describe 'tripleo::profile::base::manila::authtoken' do context 'with step 3' do let(:params) { { :step => 3, - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it { @@ -45,7 +45,7 @@ describe 'tripleo::profile::base::manila::authtoken' do context 'with step 3 with ipv6' do let(:params) { { :step => 3, - :memcached_ips => '::1', + :memcached_hosts => '::1', } } it { diff --git a/spec/classes/tripleo_profile_base_neutron_authtoken_spec.rb b/spec/classes/tripleo_profile_base_neutron_authtoken_spec.rb index 23a06f79b..31dfcf071 100644 --- a/spec/classes/tripleo_profile_base_neutron_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_neutron_authtoken_spec.rb @@ -32,7 +32,7 @@ describe 'tripleo::profile::base::neutron::authtoken' do context 'with step 3' do let(:params) { { :step => 3, - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it { @@ -45,7 +45,7 @@ describe 'tripleo::profile::base::neutron::authtoken' do context 'with step 3 with ipv6' do let(:params) { { :step => 3, - :memcached_ips => '::1', + :memcached_hosts => '::1', } } it { diff --git a/spec/classes/tripleo_profile_base_nova_authtoken_spec.rb b/spec/classes/tripleo_profile_base_nova_authtoken_spec.rb index 0a87bf4cf..3bc1f66f0 100644 --- a/spec/classes/tripleo_profile_base_nova_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_nova_authtoken_spec.rb @@ -32,7 +32,7 @@ describe 'tripleo::profile::base::nova::authtoken' do context 'with step 3' do let(:params) { { :step => 3, - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it { @@ -45,7 +45,7 @@ describe 'tripleo::profile::base::nova::authtoken' do context 'with step 3 with ipv6' do let(:params) { { :step => 3, - :memcached_ips => '::1', + :memcached_hosts => '::1', } } it { diff --git a/spec/classes/tripleo_profile_base_nova_spec.rb b/spec/classes/tripleo_profile_base_nova_spec.rb index 25a6149e6..c139aef4a 100644 --- a/spec/classes/tripleo_profile_base_nova_spec.rb +++ b/spec/classes/tripleo_profile_base_nova_spec.rb @@ -54,7 +54,7 @@ describe 'tripleo::profile::base::nova' do is_expected.to contain_class('nova::config') is_expected.to contain_class('nova::logging') is_expected.to contain_class('nova::cache').with( - :memcache_servers => ['127.0.0.1:11211'] + :memcache_servers => ['controller-1:11211'] ) is_expected.to contain_class('nova::placement') is_expected.to contain_class('nova::keystone::service_user') diff --git a/spec/classes/tripleo_profile_base_octavia_authtoken_spec.rb b/spec/classes/tripleo_profile_base_octavia_authtoken_spec.rb index c39c5f0f9..a5b490912 100644 --- a/spec/classes/tripleo_profile_base_octavia_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_octavia_authtoken_spec.rb @@ -32,7 +32,7 @@ describe 'tripleo::profile::base::octavia::authtoken' do context 'with step 3' do let(:params) { { :step => 3, - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it { @@ -45,7 +45,7 @@ describe 'tripleo::profile::base::octavia::authtoken' do context 'with step 3 with ipv6' do let(:params) { { :step => 3, - :memcached_ips => '::1', + :memcached_hosts => '::1', } } it { diff --git a/spec/classes/tripleo_profile_base_panko_authtoken_spec.rb b/spec/classes/tripleo_profile_base_panko_authtoken_spec.rb index 93b7ab121..15a27e99c 100644 --- a/spec/classes/tripleo_profile_base_panko_authtoken_spec.rb +++ b/spec/classes/tripleo_profile_base_panko_authtoken_spec.rb @@ -32,7 +32,7 @@ describe 'tripleo::profile::base::panko::authtoken' do context 'with step 3' do let(:params) { { :step => 3, - :memcached_ips => '127.0.0.1', + :memcached_hosts => '127.0.0.1', } } it { @@ -45,7 +45,7 @@ describe 'tripleo::profile::base::panko::authtoken' do context 'with step 3 with ipv6' do let(:params) { { :step => 3, - :memcached_ips => '::1', + :memcached_hosts => '::1', } } it { diff --git a/spec/fixtures/hieradata/default.yaml b/spec/fixtures/hieradata/default.yaml index cd2ddcf60..f23806510 100644 --- a/spec/fixtures/hieradata/default.yaml +++ b/spec/fixtures/hieradata/default.yaml @@ -94,10 +94,8 @@ placement_short_bootstrap_node_name: node placement::rabbit_password: 'password' placement::keystone::authtoken::password: 'password' # memcache related items -memcached_node_ips_v6: - - '::1' -memcached_node_ips: - - '127.0.0.1' +memcached_node_names: + - 'controller-1' # octavia related items octavia::rabbit_password: 'password' octavia::keystone::authtoken::password: 'password'