aboutsummaryrefslogtreecommitdiffstats
path: root/docker/services/pacemaker/haproxy.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'docker/services/pacemaker/haproxy.yaml')
-rw-r--r--docker/services/pacemaker/haproxy.yaml12
1 files changed, 10 insertions, 2 deletions
diff --git a/docker/services/pacemaker/haproxy.yaml b/docker/services/pacemaker/haproxy.yaml
index 29bd22af..a325f286 100644
--- a/docker/services/pacemaker/haproxy.yaml
+++ b/docker/services/pacemaker/haproxy.yaml
@@ -224,6 +224,14 @@ outputs:
- name: set is_bootstrap_node fact
tags: common
set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
+ - name: Check cluster resource status
+ tags: step2
+ pacemaker_resource:
+ resource: {get_attr: [HAProxyBase, role_data, service_name]}
+ state: started
+ check_mode: true
+ ignore_errors: true
+ register: haproxy_res
- name: Disable the haproxy cluster resource.
tags: step2
pacemaker_resource:
@@ -233,7 +241,7 @@ outputs:
register: output
retries: 5
until: output.rc == 0
- when: is_bootstrap_node
+ when: is_bootstrap_node and haproxy_res|succeeded
- name: Delete the stopped haproxy cluster resource.
tags: step2
pacemaker_resource:
@@ -243,4 +251,4 @@ outputs:
register: output
retries: 5
until: output.rc == 0
- when: is_bootstrap_node
+ when: is_bootstrap_node and haproxy_res|succeeded