From 77527bb050ba8ae7fb2c67742466e099818fb446 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Mon, 19 Mar 2018 19:05:58 +0100 Subject: [PATCH] Make the 'Could not find data item hacluster_pwd' error a bit clearer If you deploy a role with a pacemaker-managed service (galera, rabbit, redis, etc) but forgot to add the ::tripleo::profile::base::pacemaker there will be a rather unintuitive error: puppet apply --debug --verbose --detailed-exitcodes --summarize --color=false --modulepath /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/module --tags file,file_line,concat,augeas,pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation -e 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::database::redis_bundle'", Error: Evaluation Error: Error while evaluating a Function Call, Could not find data item hacluster_pwd in any Hiera data file and no default supplied at /etc/puppet/modules/tripleo/manifests/profile/base/pacemaker.pp:127:24 on node role-2.localdomain Let's make it a bit clearer. Long-term we want to look at a validation that covers this. Change-Id: Iffb6e76cdd0286ef10ada57c70ce31971e42c84f --- manifests/profile/base/pacemaker.pp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifests/profile/base/pacemaker.pp b/manifests/profile/base/pacemaker.pp index 4c11c0d4a..ea48540dd 100644 --- a/manifests/profile/base/pacemaker.pp +++ b/manifests/profile/base/pacemaker.pp @@ -90,6 +90,10 @@ class tripleo::profile::base::pacemaker ( fail("Count of ${remote_short_node_names} is not equal to count of ${remote_node_ips}") } + if hiera('hacluster_pwd', undef) == undef { + fail("The 'hacluster_pwd' hiera key is undefined, did you forget to include ::tripleo::profile::base::pacemaker in your role?") + } + Pcmk_resource <| |> { tries => 10, try_sleep => 3,