5 pacemaker_status=$(systemctl is-active pacemaker)
8 function check_resource {
14 tend=$(( $tstart + $timeout ))
16 if [ "$state" = "stopped" ]; then
17 match_for_incomplete='Started'
19 match_for_incomplete='Stopped'
22 while (( $(date +%s) < $tend )); do
23 node_states=$(pcs status --full | grep "$service" | grep -v Clone)
24 if echo "$node_states" | grep -q "$match_for_incomplete"; then
25 echo "$service not yet $state, sleeping $check_interval seconds."
28 echo "$service has $state"
33 echo "$service never $state after $timeout seconds" | tee /dev/fd/2
38 # Run if pacemaker is running, we're the bootstrap node,
39 # and we're updating the deployment (not creating).
40 if [ "$pacemaker_status" = "active" -a \
41 "$(hiera bootstrap_nodeid)" = "$(facter hostname)" -a \
42 "$(hiera update_identifier)" != "nil" ]; then
44 #ensure neutron constraints like
45 #https://review.openstack.org/#/c/245093/
46 if pcs constraint order show | grep "start neutron-server-clone then start neutron-ovs-cleanup-clone"; then
47 pcs constraint remove order-neutron-server-clone-neutron-ovs-cleanup-clone-mandatory
50 pcs resource disable httpd
51 check_resource httpd stopped 300
52 pcs resource disable openstack-keystone
53 check_resource openstack-keystone stopped 1200
55 if pcs status | grep haproxy-clone; then
56 pcs resource restart haproxy-clone
58 pcs resource restart redis-master
59 pcs resource restart mongod-clone
60 pcs resource restart rabbitmq-clone
61 pcs resource restart memcached-clone
62 pcs resource restart galera-master
64 pcs resource enable openstack-keystone
65 check_resource openstack-keystone started 300
66 pcs resource enable httpd
67 check_resource httpd started 800