Add ask_confirmation parameter for ceph-upgrade pipeline

Change-Id: Ief9c87613a3af96db4f519e1e0bdeccbe3d9944f
Related-Prod: PROD-36027
diff --git a/ceph-upgrade.groovy b/ceph-upgrade.groovy
index 25b4748..39695f2 100644
--- a/ceph-upgrade.groovy
+++ b/ceph-upgrade.groovy
@@ -9,6 +9,7 @@
  *  ADMIN_HOST                      Host (minion id) with admin keyring and /etc/crushmap file present
  *  CLUSTER_FLAGS                   Comma separated list of tags to apply to cluster
  *  WAIT_FOR_HEALTHY                Wait for cluster rebalance before stoping daemons
+ *  ASK_CONFIRMATION                Ask for manual confirmation
  *  ORIGIN_RELEASE                  Ceph release version before upgrade
  *  TARGET_RELEASE                  Ceph release version after upgrade
  *  STAGE_UPGRADE_MON               Set to True if Ceph mon nodes upgrade is desired
@@ -26,6 +27,7 @@
 salt = new com.mirantis.mk.Salt()
 def python = new com.mirantis.mk.Python()
 ceph = new com.mirantis.mk.Ceph()
+askConfirmation = (env.getProperty('ASK_CONFIRMATION') ?: true).toBoolean()
 
 pepperEnv = "pepperEnv"
 flags = CLUSTER_FLAGS.tokenize(',')
@@ -129,8 +131,10 @@
                 salt.cmdRun(master, "${minion}", "systemctl status ceph-${target}.target")
             }
 
-            stage('Ask for manual confirmation') {
-                input message: "From the verification command above, please check Ceph ${target} joined the cluster correctly. If so, Do you want to continue to upgrade next node?"
+            if (askConfirmation) {
+                stage('Ask for manual confirmation') {
+                    input message: "From the verification command above, please check Ceph ${target} joined the cluster correctly. If so, Do you want to continue to upgrade next node?"
+                }
             }
         }
     }