Only create veritas rabbitmq users on the bootstrap node

Currently, when deploying an overcloud with veritas hyperscale, the
hyperscale rabbitmq user gets created on all rabbit nodes. This is
problematic on an HA deployment for two reasons:
A) rabbitmq already mirrors users
B) On non bootstrap node this will fail because the rabbit pcmk resource
creation happens only on the bootstrap node, which means that when the
hyperscale rabbitmq include kicks in on non-bootstrap nodes it will try
to prefetch all rabbitmq users via 'rabbitmqctl -q list_users' and
fail because there are no guarantees that rabbit is up and running since
no rabbitmq puppet stuff gets executed there. I.e. on non-bootstrap
nodes the Exec['rabbitmq-ready] -> Rabbitmq_users<||> won't work.

While we're at it we move this rabbitmq user process to step2. rabbitmq
get started and created at step2 so it makes no sense to invoke user
creation before that.

Note that this should be considered a short-term fix only. The proper
fix should be (if possible) to move the veritas rabbitmq user
configuration in the dedicated veritas service.

Closes-Bug: #1739026

Change-Id: I36950b9cec9f02a0de55292342a3a699df0b3cf1
(cherry picked from commit 9fbfc6889d)
This commit is contained in:
Michele Baldessari 2017-12-15 20:24:48 +01:00 committed by Emilien Macchi
parent 955e489b83
commit 7534f0c398
1 changed files with 11 additions and 1 deletions

View File

@ -76,6 +76,10 @@
# for more details.
# Defaults to hiera('step')
#
# [*bootstrap_node*]
# (Optional) The hostname of the node responsible for bootstrapping tasks
# Defaults to hiera('rabbitmq_short_bootstrap_node_name')
#
class tripleo::profile::base::rabbitmq (
$certificate_specs = {},
$config_variables = hiera('rabbitmq_config_variables'),
@ -89,6 +93,7 @@ class tripleo::profile::base::rabbitmq (
$rabbitmq_user = hiera('rabbitmq::default_user'),
$stack_action = hiera('stack_action'),
$step = Integer(hiera('step')),
$bootstrap_node = hiera('rabbitmq_short_bootstrap_node_name'),
) {
if $enable_internal_tls {
$tls_certfile = $certificate_specs['service_certificate']
@ -168,7 +173,12 @@ class tripleo::profile::base::rabbitmq (
}
}
if $step >= 1 and hiera('veritas_hyperscale_controller_enabled', false) {
if $::hostname == downcase($bootstrap_node) {
$rabbitmq_bootstrapnode = true
} else {
$rabbitmq_bootstrapnode = false
}
if $rabbitmq_bootstrapnode and $step >= 2 and hiera('veritas_hyperscale_controller_enabled', false) {
include ::veritas_hyperscale::hs_rabbitmq
}
}