X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=mcp%2Fconfig%2Fstates%2Fopenstack_ha;h=fbddc6e836d4b751a077a96e51e14be7ee5d2645;hb=f8322ce158dab307290aecb95864d86b0e88fb20;hp=8ca76e49f50fb96e33590bd8a5675d5789c47c0b;hpb=65881204a20b82b1ba972f9a8b79720d9b15d5f7;p=fuel.git diff --git a/mcp/config/states/openstack_ha b/mcp/config/states/openstack_ha index 8ca76e49f..fbddc6e83 100755 --- a/mcp/config/states/openstack_ha +++ b/mcp/config/states/openstack_ha @@ -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 @@ -24,17 +35,17 @@ salt -I 'haproxy:proxy' service.restart rsyslog salt -I 'keystone:server' state.sls keystone.server -b 1 salt -I 'keystone:server' service.restart apache2 -salt -I 'keystone:client' state.sls keystone.client +wait_for 30 "salt -I 'keystone:client' state.sls keystone.client" salt -I 'keystone:server' cmd.run ". /root/keystonercv3; openstack service list" salt -I 'glance:server' state.sls glance -b 1 -salt -I 'glance:server' state.sls glusterfs.client +salt -I 'glusterfs:client' state.sls glusterfs.client salt -I 'keystone:server' state.sls keystone.server salt -I 'nova:controller' state.sls nova -b 1 salt -I 'heat:server' state.sls heat -b 1 -salt -I 'cinder:controller' state.sls cinder -b 1 +wait_for 5 "salt -I 'cinder:controller' state.sls cinder -b 1" salt -I 'cinder:volume' state.sls cinder salt -I 'neutron:server' state.sls neutron -b 1 @@ -42,20 +53,24 @@ 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 salt -I 'horizon:server' state.sls horizon -salt -I 'nginx:server' state.sls nginx +salt -I 'nginx:server' state.sls nginx,sphinx clstr_vip_addr=$(salt -C 'I@nginx:server and *01*' --out=yaml \ pillar.get _param:cluster_vip_address | awk '{print $2; exit}') salt -C 'I@nginx:server and *01*' cp.push \ - /etc/ssl/certs/${clstr_vip_addr}-with-chain.crt upload_path='certs/os_cacert' -cd /etc/ssl/certs && ln -s /var/cache/salt/master/minions/prx01.*/files/certs/os_cacert + "/etc/ssl/certs/${clstr_vip_addr}-with-chain.crt" upload_path='certs/os_cacert' +cd /etc/ssl/certs && ln -sf /var/cache/salt/master/minions/prx01.*/files/certs/os_cacert + +# glance v1 api is required by orchestra tests +salt -I 'glance:server' ini.set_option /etc/glance/glance-api.conf '{DEFAULT: {enable_v1_api: True}}' +salt -I 'glance:server' service.restart glance-api