Merge "Added condition to check if array with rbd monitoring enabled pools is empty. Related-Prod: PROD-35525"
diff --git a/ceph/mgr.sls b/ceph/mgr.sls
index da450bb..9aa1799 100644
--- a/ceph/mgr.sls
+++ b/ceph/mgr.sls
@@ -132,6 +132,7 @@
         {%- do rbd_pools.append(pool_name) %}
       {%- endif %}
     {%- endfor %}
+  {%- if  rbd_pools %}
 enable_rbd_metrics:
   cmd.run:
   - name: "ceph config set mgr mgr/prometheus/rbd_stats_pools {{ rbd_pools|join(',') }}"
@@ -140,6 +141,7 @@
     - cmd: ceph_mgr_wait_functional
     - file: common_config
     - file: /var/lib/ceph/mgr/{{ common.get('cluster_name', 'ceph') }}-{{ grains.host }}/
+  {%- endif %}
 {%- endif %}
 
 {%- endif %}