salt modules: debian_ip: Accept uppercase ifaces
[fuel.git] / mcp / config / states / openstack_ha
index e11135f..9237cc0 100755 (executable)
@@ -1,5 +1,16 @@
-#!/bin/bash
-set -x
+#!/bin/bash -e
+##############################################################################
+# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x
+
+# shellcheck disable=SC1090
+source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/lib.sh"
 
 salt -I 'keepalived:cluster' state.sls keepalived -b 1
 salt -I 'keepalived:cluster' pillar.get keepalived:cluster:instance:VIP:address
@@ -42,12 +53,12 @@ salt -I 'neutron:gateway' state.sls neutron.gateway
 
 salt -I 'nova:compute' state.sls nova
 
-salt -I 'mongodb:server' state.sls mongodb
-while true; do sleep 5; salt -C 'I@mongodb:server and *01*' cmd.run 'mongo localhost:27017/admin' && break; done
+salt -I 'mongodb:server' state.sls mongodb || true
+wait_for 90 "salt -C 'I@mongodb:server and *01*' cmd.run 'mongo localhost:27017/admin'"
 salt -C 'I@mongodb:server and *01*' cmd.run 'mongo localhost:27017/admin --eval "rs.initiate()"'
 salt -C 'I@mongodb:server and *01*' state.sls mongodb
 
-salt -I 'aodh:server' state.sls aodh
+salt -I 'aodh:server' state.sls aodh -b 1
 salt -I 'ceilometer:server' state.sls ceilometer
 salt -I 'ceilometer:agent' state.sls ceilometer