Added the update salt master formulas, reclass model and jenkins
jobs pipelines
Change-Id: I45d41910a4e81a9d82c22e00b19c5806ee64d88e
diff --git a/update-reclass-metadata.groovy b/update-reclass-metadata.groovy
new file mode 100644
index 0000000..6fb539a
--- /dev/null
+++ b/update-reclass-metadata.groovy
@@ -0,0 +1,35 @@
+/**
+ * Update reclass model on salt master
+ *
+ * Expected parameters:
+ * SALT_MASTER_CREDENTIALS Credentials to the Salt API.
+ * SALT_MASTER_URL Full Salt API address [https://10.10.10.1:8000].
+ * TARGET_SERVERS Server to update
+ *
+**/
+
+def common = new com.mirantis.mk.Common()
+def salt = new com.mirantis.mk.Salt()
+
+def saltMaster
+def target = ['expression': TARGET_SERVERS, 'type': 'compound']
+def result
+
+node("python") {
+ try {
+
+ stage('Connect to Salt master') {
+ saltMaster = salt.connection(SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
+ }
+
+ stage('Update Reclass model') {
+ result = salt.runSaltCommand(saltMaster, 'local', target, 'state.apply', null, 'reclass.storage')
+ result = salt.runSaltCommand(saltMaster, 'local', target, 'state.apply', null, 'reclass.storage.node')
+ salt.checkResult(result)
+ }
+
+ } catch (Throwable e) {
+ currentBuild.result = 'FAILURE'
+ throw e
+ }
+}