Adding tests for multiple roles for singlenode deploy.
* Check for galera:slave.
It is possible to deploy galera with one node only.
No need to deploy slave.
* Check for neutron:gateway
It is possible to start all agents on kvm node in dvr.
No need to deploy special vm.
It is possible to workaraund that issues, however.
Change-Id: I5151aa2b331e7f01d401af9494d392221d200506
diff --git a/src/com/mirantis/mk/Orchestrate.groovy b/src/com/mirantis/mk/Orchestrate.groovy
index 2b15a92..dc4f86f 100644
--- a/src/com/mirantis/mk/Orchestrate.groovy
+++ b/src/com/mirantis/mk/Orchestrate.groovy
@@ -188,15 +188,20 @@
// Install galera
if (salt.testTarget(master, "I@galera:master ${extra_tgt}") || salt.testTarget(master, "I@galera:slave ${extra_tgt}")) {
salt.enforceState(master, "I@galera:master ${extra_tgt}", 'galera', true, true, null, false, -1, 2)
- salt.enforceState(master, "I@galera:slave ${extra_tgt}", 'galera', true, true, null, false, -1, 2)
+ salt.enforceStateWithTest(master, "I@galera:slave ${extra_tgt}", 'galera', true, true, null, false, -1, 2)
// Check galera status
salt.runSaltProcessStep(master, "I@galera:master ${extra_tgt}", 'mysql.status')
- salt.runSaltProcessStep(master, "I@galera:slave ${extra_tgt}", 'mysql.status')
+ if (salt.testTarget(master, "I@galera:slave ${extra_tgt}")) {
+ salt.runSaltProcessStep(master, "I@galera:slave ${extra_tgt}", 'mysql.status')
+ }
+
// If galera is not enabled check if we need to install mysql:server
} else {
- salt.enforceStateWithTest(master, "I@mysql:server ${extra_tgt}", 'mysql.server')
- salt.enforceStateWithTest(master, "I@mysql:client ${extra_tgt}", 'mysql.client')
+
+ salt.enforceStateWithTest(master, "I@mysql:server ${extra_tgt}", 'mysql.server')
+ salt.enforceStateWithTest(master, "I@mysql:client ${extra_tgt}", 'mysql.client')
+
}
installBackup(master, 'mysql', extra_tgt)
@@ -457,6 +462,7 @@
def installOpenstackNetwork(master, extra_tgt = '') {
def salt = new com.mirantis.mk.Salt()
def common = new com.mirantis.mk.Common()
+
//run full neutron state on neutron.gateway - this will install
//neutron agents in addition to neutron server. Once neutron agents
//are up neutron resources can be created without hitting the situation when neutron resources are created
@@ -468,7 +474,9 @@
//usable state. More information: https://bugs.launchpad.net/neutron/+bug/1399249
salt.enforceStateWithTest(master, "I@neutron:client ${extra_tgt}", 'neutron.client')
- salt.enforceHighstate(master, "I@neutron:gateway ${extra_tgt}")
+ if (salt.testTarget(master, "I@neutron:gateway ${extra_tgt}")) {
+ salt.enforceHighstate(master, "I@neutron:gateway ${extra_tgt}")
+ }
// install octavia manager services
if (salt.testTarget(master, "I@octavia:manager ${extra_tgt}")) {