From 6462e2e3c37d4778e27c26e1286e905009318aef Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Thu, 6 Jul 2017 12:29:50 +0100 Subject: Remove dependency on memcached_node_ips_v6 This is set via all_nodes_config in t-h-t, but it's a special case for this service, so it'll be better if we handle the ipv6 transformation in puppet instead of relying on the service specific list mangling in t-h-t (one aspect of which has been identified as a potential performance problem). Related-Bug: #1684272 Change-Id: Iccb9089db4b382db3adb9340f18f6d2364ca7f58 --- manifests/profile/base/horizon.pp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'manifests/profile/base/horizon.pp') diff --git a/manifests/profile/base/horizon.pp b/manifests/profile/base/horizon.pp index 26ea20f..3f01d01 100644 --- a/manifests/profile/base/horizon.pp +++ b/manifests/profile/base/horizon.pp @@ -31,10 +31,15 @@ # (Optional) A hash of parameters to enable features specific to Neutron # Defaults to hiera('horizon::neutron_options', {}) # +# [*memcached_ips*] +# (Optional) Array of ipv4 or ipv6 addresses for memcache. +# Defaults to hiera('memcached_node_ips') +# class tripleo::profile::base::horizon ( $step = Integer(hiera('step')), $bootstrap_node = hiera('bootstrap_nodeid', undef), $neutron_options = hiera('horizon::neutron_options', {}), + $memcached_ips = hiera('memcached_node_ips') ) { if $::hostname == downcase($bootstrap_node) { $is_bootstrap = true @@ -52,12 +57,14 @@ class tripleo::profile::base::horizon ( $_profile_support = 'None' } $neutron_options_real = merge({'profile_support' => $_profile_support }, $neutron_options) - $memcached_ipv6 = hiera('memcached_ipv6', false) - if $memcached_ipv6 { - $horizon_memcached_servers = hiera('memcached_node_ips_v6', '[::1]') + + if is_ipv6_address($memcached_ips[0]) { + $horizon_memcached_servers = prefix(any2array(normalize_ip_for_uri($memcached_ips)), 'inet6:') + } else { - $horizon_memcached_servers = hiera('memcached_node_ips', '127.0.0.1') + $horizon_memcached_servers = any2array(normalize_ip_for_uri($memcached_ips)) } + class { '::horizon': cache_server_ip => $horizon_memcached_servers, neutron_options => $neutron_options_real, -- cgit 1.2.3-korg