From 068bb7299914b59cefc7ef619db06fc957d20c50 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Mon, 1 Oct 2018 19:00:51 -0500 Subject: [PATCH] Correct failure when stopping cluster state is ignored If the user passes in the `galera_ignore_cluster_state=true` flag, like in the case of a node addition or a rolling replacement of nodes, this role will fail to execute on all new nodes due to the existance of a functioning cluster galera cluster. The first task in the pre-upgrade steps attempts to stop the mysql service prior to running anything else. This change makes it so the mysql service will not fail to stop on this pre-upgrade task when the `galera_ignore_cluster_state=true` is passed through. Change-Id: Id9c4f11b3536e7f9d510f5ef8e6d82a82a96adac Signed-off-by: Kevin Carter --- tasks/galera_upgrade_pre.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/galera_upgrade_pre.yml b/tasks/galera_upgrade_pre.yml index 56e61292..ef010a96 100644 --- a/tasks/galera_upgrade_pre.yml +++ b/tasks/galera_upgrade_pre.yml @@ -14,9 +14,10 @@ # limitations under the License. - name: Stop MariaDB - service: + systemd: name: mysql state: stopped + failed_when: "{{ (not galera_ignore_cluster_state | bool) | default(omit, false) }}" register: galera_restart_fall_back until: galera_restart_fall_back is success retries: 3