blob: 6fb539afd04ba1c24f5f4b738ac173d534c32f66 [file] [log] [blame]
Ales Komarek585bd462017-08-24 09:33:32 +02001/**
2 * Update reclass model on salt master
3 *
4 * Expected parameters:
5 * SALT_MASTER_CREDENTIALS Credentials to the Salt API.
6 * SALT_MASTER_URL Full Salt API address [https://10.10.10.1:8000].
7 * TARGET_SERVERS Server to update
8 *
9**/
10
11def common = new com.mirantis.mk.Common()
12def salt = new com.mirantis.mk.Salt()
13
14def saltMaster
15def target = ['expression': TARGET_SERVERS, 'type': 'compound']
16def result
17
18node("python") {
19 try {
20
21 stage('Connect to Salt master') {
22 saltMaster = salt.connection(SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
23 }
24
25 stage('Update Reclass model') {
26 result = salt.runSaltCommand(saltMaster, 'local', target, 'state.apply', null, 'reclass.storage')
27 result = salt.runSaltCommand(saltMaster, 'local', target, 'state.apply', null, 'reclass.storage.node')
28 salt.checkResult(result)
29 }
30
31 } catch (Throwable e) {
32 currentBuild.result = 'FAILURE'
33 throw e
34 }
35}