Browse Source

Merge "Make execution of the backup idempotent" into stable/train

stable/train
Zuul 4 days ago
committed by Gerrit Code Review
parent
commit
61eb63e17f
4 changed files with 50 additions and 7 deletions
  1. +34
    -0
      tripleo_ansible/roles/backup-and-restore/backup/tasks/db_backup.yml
  2. +1
    -0
      tripleo_ansible/roles/backup-and-restore/backup/tasks/service_manager_pause.yml
  3. +6
    -0
      tripleo_ansible/roles/backup-and-restore/tasks/ceph_authentication.yml
  4. +9
    -7
      tripleo_ansible/roles/backup-and-restore/tasks/main.yml

+ 34
- 0
tripleo_ansible/roles/backup-and-restore/backup/tasks/db_backup.yml View File

@ -48,6 +48,29 @@
tags:
- bar_create_recover_image
- name: Enable pacemaker if it is stopped
command: pcs cluster start --all
when:
- enabled_galera
- tripleo_backup_and_restore_service_manager|bool
run_once: true
tags:
- bar_create_recover_image
- name: Wait until pacemaker has Galera up&running
shell: |
set -o pipefail
netstat -tunlp | grep ":3306 " | sed -e 's/.*\///'
register: mysql_result
retries: 300
until: mysql_result is search('mysqld')
delay: 5
when:
- enabled_galera
- tripleo_backup_and_restore_service_manager|bool
tags:
- bar_create_recover_image
- name: Get the mysql container id when galera is enabled
shell: |
set -o pipefail
@ -65,6 +88,17 @@
tags:
- bar_create_recover_image
- name: Unpause mysql for backup if it is paused
command: "{{ tripleo_container_cli }} unpause {{ tripleo_backup_and_restore_mysql_container }}"
when:
- mysql_password.stderr is defined
- tripleo_backup_and_restore_mysql_container == "mysql"
- not enabled_galera
- tripleo_backup_and_restore_service_manager|bool
failed_when: false
tags:
- bar_create_recover_image
- name: MySQL Grants backup
shell: |
set -o pipefail


+ 1
- 0
tripleo_ansible/roles/backup-and-restore/backup/tasks/service_manager_pause.yml View File

@ -39,6 +39,7 @@
/usr/bin/{{ tripleo_container_cli }} ps --format '{{ '{{' }}.Names {{ '}}' }} ' | /usr/bin/egrep -v 'galera|mysql|bundle'
register: container_services
changed_when: container_services.stdout is undefined
failed_when: false
tags:
- bar_create_recover_image


+ 6
- 0
tripleo_ansible/roles/backup-and-restore/tasks/ceph_authentication.yml View File

@ -32,6 +32,12 @@
tags:
- always
- name: Unpause ceph mon container if paused
command: "{{ tripleo_container_cli }} unpause ceph-mon-{{ ansible_facts['hostname'] }}"
failed_when: false
tags:
- bar_create_recover_image
- name: Export ceph authentication
shell: |
set -o pipefail


+ 9
- 7
tripleo_ansible/roles/backup-and-restore/tasks/main.yml View File

@ -49,10 +49,12 @@
- name: Backup pacemaker configuration
import_tasks: pacemaker_backup.yml
- name: Create recovery images with ReaR
import_tasks: ../backup/tasks/main.yml
- name: Service management
import_tasks: ../backup/tasks/service_manager_unpause.yml
when:
- tripleo_backup_and_restore_service_manager
- name: Perform backup
block:
- name: Create recovery images with ReaR
import_tasks: ../backup/tasks/main.yml
always:
- name: Service management
import_tasks: ../backup/tasks/service_manager_unpause.yml
when:
- tripleo_backup_and_restore_service_manager

Loading…
Cancel
Save