From a1ae19060bc60cab8638b5e410cf54dc7aa349b9 Mon Sep 17 00:00:00 2001 From: Juan Larriba Date: Wed, 7 Jul 2021 15:30:04 +0200 Subject: [PATCH] Backup and Restore playbook is not 100% idempotent when running in snapshot mode This fix a small issue that can happen when the user directly cancels the execution of the playbook when the rear backup is happening. After that, the node remains disconnected from pacemaker and it is necessary to add it back to the cluster so the mysql-galera container is running when we do the mysql dump. As the pcs cluster start is an idempotent command in itself, we do not need to perform a verification check before running it nor it will generate errors (return 1) when ran if it was already running. Closes-Bug: #1934897 Change-Id: I9a425665f4714751d8b1a0bd381533e4c383df9d (cherry picked from commit aa93f9d7a05d33bdf0aa6177da10f51a1e784bc2) (cherry picked from commit a22d8d9817e07b76ccd83211659fea55796b735b) --- .../roles/backup_and_restore/tasks/db_backup.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tripleo_ansible/roles/backup_and_restore/tasks/db_backup.yml b/tripleo_ansible/roles/backup_and_restore/tasks/db_backup.yml index df8a92fe8..a25cf3ab1 100644 --- a/tripleo_ansible/roles/backup_and_restore/tasks/db_backup.yml +++ b/tripleo_ansible/roles/backup_and_restore/tasks/db_backup.yml @@ -58,6 +58,14 @@ tags: - bar_create_recover_image +- name: Ensure the node is back into the cluster + command: pcs cluster start + when: + - enabled_galera + - tripleo_backup_and_restore_enable_snapshots|bool + tags: + - bar_create_recover_image + - name: Wait until pacemaker has Galera up&running shell: | set -o pipefail @@ -68,8 +76,6 @@ delay: 5 when: - enabled_galera - - tripleo_backup_and_restore_service_manager|bool - - not tripleo_backup_and_restore_enable_snapshots|bool tags: - bar_create_recover_image