summaryrefslogtreecommitdiffstats
path: root/docker/services/pacemaker/database
diff options
context:
space:
mode:
authorMarius Cornea <mcornea@redhat.com>2017-09-07 15:38:54 +0200
committerMarius Cornea <mcornea@redhat.com>2017-09-15 14:25:16 +0000
commitdc9d9893717b819cf65893573199db8b473d284f (patch)
tree109a56ab304b373890dce68cb5c946eaa1682f4a /docker/services/pacemaker/database
parent2ada42c10949dfb668581d9690011a16383f23d5 (diff)
One time delete pacemaker resources during upgrade to containers
This change allows running the major upgrade composable docker steps multiple times by not trying to delete the pacemaker resources if they're not reported as started or in master state. Closes-bug: 1716031 Depends-On: I8da03f5c4a6d442617b81be5793a9724cc8842bf Change-Id: Ifcf9de8c82550a90a9fb118052d43fdbcdc6ca7e (cherry picked from commit 64d7be1e3d4552e06cbc53f788572e530cc5c3bb)
Diffstat (limited to 'docker/services/pacemaker/database')
-rw-r--r--docker/services/pacemaker/database/mysql.yaml12
-rw-r--r--docker/services/pacemaker/database/redis.yaml12
2 files changed, 20 insertions, 4 deletions
diff --git a/docker/services/pacemaker/database/mysql.yaml b/docker/services/pacemaker/database/mysql.yaml
index 1e1b2baf..4d5a0a15 100644
--- a/docker/services/pacemaker/database/mysql.yaml
+++ b/docker/services/pacemaker/database/mysql.yaml
@@ -266,6 +266,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: galera
+ state: master
+ check_mode: true
+ ignore_errors: true
+ register: galera_res
- name: Disable the galera cluster resource
tags: step2
pacemaker_resource:
@@ -275,7 +283,7 @@ outputs:
register: output
retries: 5
until: output.rc == 0
- when: is_bootstrap_node
+ when: is_bootstrap_node and galera_res|succeeded
- name: Delete the stopped galera cluster resource.
tags: step2
pacemaker_resource:
@@ -285,7 +293,7 @@ outputs:
register: output
retries: 5
until: output.rc == 0
- when: is_bootstrap_node
+ when: is_bootstrap_node and galera_res|succeeded
- name: Disable mysql service
tags: step2
service: name=mariadb enabled=no
diff --git a/docker/services/pacemaker/database/redis.yaml b/docker/services/pacemaker/database/redis.yaml
index 4ebeae85..4d26a084 100644
--- a/docker/services/pacemaker/database/redis.yaml
+++ b/docker/services/pacemaker/database/redis.yaml
@@ -222,6 +222,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: [RedisBase, role_data, service_name]}
+ state: master
+ check_mode: true
+ ignore_errors: true
+ register: redis_res
- name: Disable the redis cluster resource
tags: step2
pacemaker_resource:
@@ -231,7 +239,7 @@ outputs:
register: output
retries: 5
until: output.rc == 0
- when: is_bootstrap_node
+ when: is_bootstrap_node and redis_res|succeeded
- name: Delete the stopped redis cluster resource.
tags: step2
pacemaker_resource:
@@ -241,7 +249,7 @@ outputs:
register: output
retries: 5
until: output.rc == 0
- when: is_bootstrap_node
+ when: is_bootstrap_node and redis_res|succeeded
- name: Disable redis service
tags: step2
service: name=redis enabled=no