Merge "Fix issue with cluster status checking for rabbitmq-server version 3.8 and above"
diff --git a/rabbitmq/upgrade/verify/_service.sls b/rabbitmq/upgrade/verify/_service.sls
index e212b2a..9bf9221 100644
--- a/rabbitmq/upgrade/verify/_service.sls
+++ b/rabbitmq/upgrade/verify/_service.sls
@@ -6,10 +6,11 @@
{%- if server.get('enabled') %}
{% set host_id = salt['network.get_hostname']() %}
+{% set rmq_version = salt['pkg.version']('rabbitmq-server') %}
rabbitmq_status:
cmd.run:
- - name: rabbitmqctl cluster_status |grep -w running_nodes |grep -w {{ host_id }}
+ - name: rabbitmqctl cluster_status{%- if salt['pkg.version_cmp'](rmq_version,'3.8') >= 0 %} --formatter erlang {%- endif %}|grep -w running_nodes |grep -w {{ host_id }}
{%- if grains.get('noservices') %}
- onlyif: /bin/false
{%- endif %}