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"
29 timeout -k 10 $timeout crm_resource --wait
34 echo "$service never $state after $timeout seconds" | tee /dev/fd/2
39 # Run if pacemaker is running, we're the bootstrap node,
40 # and we're updating the deployment (not creating).
41 if [ "$pacemaker_status" = "active" -a \
42 "$(hiera bootstrap_nodeid)" = "$(facter hostname)" -a \
43 "$(hiera update_identifier)" != "nil" ]; then
45 #ensure neutron constraints like
46 #https://review.openstack.org/#/c/245093/
47 if pcs constraint order show | grep "start neutron-server-clone then start neutron-ovs-cleanup-clone"; then
48 pcs constraint remove order-neutron-server-clone-neutron-ovs-cleanup-clone-mandatory
51 pcs resource disable httpd
52 check_resource httpd stopped 300
53 pcs resource disable openstack-keystone
54 check_resource openstack-keystone stopped 1800
56 if pcs status | grep haproxy-clone; then
57 pcs resource restart haproxy-clone
59 pcs resource restart redis-master
60 pcs resource restart mongod-clone
61 pcs resource restart rabbitmq-clone
62 pcs resource restart memcached-clone
63 pcs resource restart galera-master
65 pcs resource enable openstack-keystone
66 check_resource openstack-keystone started 1800
67 pcs resource enable httpd
68 check_resource httpd started 800