From 207e6d621e5055a62c557fb051621f34c96c8e42 Mon Sep 17 00:00:00 2001 From: Damien Ciabrini Date: Thu, 27 Feb 2020 12:35:32 +0100 Subject: [PATCH] HA: fix rabbitmq readiness check for rabbitmq-server 3.8 In HA profiles, we wait for rabbitmq application readiness by parsing the output of "rabbitmqctl status". This breaks with rabbitmq-server 3.8 which changed the output of that command. Fix our check by using a "rabbitmqctl eval" and by relying on a stable function call rather than parsing output. This approach works for rabbitmq-server 3.6 to 3.8. Change-Id: Id88d0aee74e4b26fd64bbc2da5d0c0fc4bbd6644 Co-Authored-By: Yatin Karel Closes-Bug: #1864962 (cherry picked from commit e60351ee09eed0217d52aa1bad80f8c02501f0fe) --- manifests/profile/pacemaker/rabbitmq.pp | 2 +- manifests/profile/pacemaker/rabbitmq_bundle.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/profile/pacemaker/rabbitmq.pp b/manifests/profile/pacemaker/rabbitmq.pp index 1881e580d..8c4d57a1f 100644 --- a/manifests/profile/pacemaker/rabbitmq.pp +++ b/manifests/profile/pacemaker/rabbitmq.pp @@ -151,7 +151,7 @@ class tripleo::profile::pacemaker::rabbitmq ( # replicated around the cluster exec { 'rabbitmq-ready': path => '/usr/sbin:/usr/bin:/sbin:/bin', - command => 'rabbitmqctl status | grep -F "{rabbit,"', + command => 'rabbitmqctl eval "lists:keymember(rabbit, 1, application:which_applications())." | grep -q true', timeout => 30, tries => 180, try_sleep => 10, diff --git a/manifests/profile/pacemaker/rabbitmq_bundle.pp b/manifests/profile/pacemaker/rabbitmq_bundle.pp index f511cf7de..163514320 100644 --- a/manifests/profile/pacemaker/rabbitmq_bundle.pp +++ b/manifests/profile/pacemaker/rabbitmq_bundle.pp @@ -341,7 +341,7 @@ class tripleo::profile::pacemaker::rabbitmq_bundle ( } if size($rabbit_nodes) == 1 { - $check_command = 'rabbitmqctl status | grep -F "{rabbit,"' + $check_command = 'rabbitmqctl eval "lists:keymember(rabbit, 1, application:which_applications())." | grep -q true' } else { # This grep makes sure the rabbit app in erlang is up and running # which is enough to guarantee that the user will eventually get