From fbda281c33bac10ba6d47adb3ef6540c610c4709 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 23 Jun 2022 22:07:12 +0900 Subject: [PATCH] HAProxy: Replace hiera by lookup (1) The hiera function is deprecated and does not work with the latest hieradata version 5. It should be replaced by the new lookup function[1]. [1] https://puppet.com/docs/puppet/7/hiera_automatic.html With the lookup function, we can define value type and merge behavior, but these are kept default at this moment to limit scope of this change to just simple replacement. Adding value type might be useful to make sure the value is in expected type (especially when a boolean value is expected), but we will revisit that later. example: lookup(, [], [], []) Change-Id: I1d8630d427b353daab17c3661b1fdea9e38a1814 --- manifests/profile/base/haproxy.pp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/manifests/profile/base/haproxy.pp b/manifests/profile/base/haproxy.pp index d492cf1c7..c90a21237 100644 --- a/manifests/profile/base/haproxy.pp +++ b/manifests/profile/base/haproxy.pp @@ -34,17 +34,17 @@ # # [*enable_load_balancer*] # (Optional) Whether or not loadbalancer is enabled. -# Defaults to hiera('enable_load_balancer', true). +# Defaults to lookup('enable_load_balancer', undef, undef, true). # # [*step*] # (Optional) The current step in deployment. See tripleo-heat-templates # for more details. -# Defaults to hiera('step') +# Defaults to Integer(lookup('step')) # class tripleo::profile::base::haproxy ( - $certificates_specs = {}, - $enable_load_balancer = hiera('enable_load_balancer', true), - $step = Integer(hiera('step')), + $certificates_specs = {}, + $enable_load_balancer = lookup('enable_load_balancer', undef, undef, true), + $step = Integer(lookup('step')), ) { if $step >= 1 { if $enable_load_balancer {