Add CLUSTER_FLAGS parameter to ceph jobs

PROD-34054

Change-Id: I2d699fc6c5bdde8dd7a5516ed2f9b031d028c37c
diff --git a/ceph-add-osd-upmap.groovy b/ceph-add-osd-upmap.groovy
index a4dd8f2..c193d39 100644
--- a/ceph-add-osd-upmap.groovy
+++ b/ceph-add-osd-upmap.groovy
@@ -14,6 +14,7 @@
 def ceph = new com.mirantis.mk.Ceph()
 orchestrate = new com.mirantis.mk.Orchestrate()
 pepperEnv = "pepperEnv"
+def flags = CLUSTER_FLAGS ? CLUSTER_FLAGS.tokenize(',') : []
 
 def runCephCommand(cmd) {
     return salt.cmdRun(pepperEnv, "I@ceph:mon and I@ceph:common:keyring:admin", cmd, checkResponse = true, batch = null, output = false)
@@ -89,7 +90,7 @@
         }
 
         stage("wait for healthy cluster") {
-            ceph.waitForHealthy(pepperEnv, "I@ceph:mon and I@ceph:common:keyring:admin")
+            ceph.waitForHealthy(pepperEnv, "I@ceph:mon and I@ceph:common:keyring:admin", flags)
         }
     }
 }
diff --git a/update-ceph.groovy b/update-ceph.groovy
index 2fb3ac9..55407f5 100644
--- a/update-ceph.groovy
+++ b/update-ceph.groovy
@@ -14,6 +14,7 @@
 def command
 def commandKwargs
 def selMinions = []
+def flags = CLUSTER_FLAGS ? CLUSTER_FLAGS.tokenize(',') : []
 
 timeout(time: 12, unit: 'HOURS') {
     node() {
@@ -43,12 +44,12 @@
                 for (tgt in selMinions) {
                     // runSaltProcessStep 'service.restart' don't work for this services
                     salt.cmdRun(pepperEnv, tgt, "systemctl restart ceph-mon.target")
-                    ceph.waitForHealthy(pepperEnv, tgt)
+                    ceph.waitForHealthy(pepperEnv, tgt, flags)
                 }
                 selMinions = salt.getMinions(pepperEnv, "I@ceph:radosgw")
                 for (tgt in selMinions) {
                     salt.cmdRun(pepperEnv, tgt, "systemctl restart ceph-radosgw.target")
-                    ceph.waitForHealthy(pepperEnv, tgt)
+                    ceph.waitForHealthy(pepperEnv, tgt, flags)
                 }
             }
 
@@ -66,11 +67,12 @@
                     }
 
                     salt.cmdRun(pepperEnv, tgt, 'ceph osd set noout')
+                    flags = 'noout' in flags ? flags : flags + ['noout']
 
                     for (i in osd_ids) {
                         salt.runSaltProcessStep(pepperEnv, tgt, 'service.restart', ['ceph-osd@' + i.replaceAll('osd.', '')], null, true)
                         // wait for healthy cluster
-                        ceph.waitForHealthy(pepperEnv, tgt, ['noout'], 0, 100)
+                        ceph.waitForHealthy(pepperEnv, tgt, flags, 0, 100)
                     }
 
                     salt.cmdRun(pepperEnv, tgt, 'ceph osd unset noout')