blob: 6fb539afd04ba1c24f5f4b738ac173d534c32f66 [file] [log] [blame]
/**
* 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
}
}