shrink_lv/bigboot_rear_backup.yml

39 lines
1.1 KiB
YAML

---
- name: ReaR Backup Playbook
hosts: all
become: true
gather_facts: true
strategy: free
vars_files:
- bigboot_vars.yml
tasks:
- name: Import rear_vars role
ansible.builtin.import_role:
name: rhc.rear.rear_vars
- name: Fetch the template name from NFS exports
ansible.builtin.set_fact:
job_template_name: "{{ nfs_exports_template_name }}"
- name: Check for previous backup completion
ansible.builtin.stat:
path: "{{ rear_backup_success_file_path }}/{{ rear_backup_workflow }}_rear_success"
register: rear_backup_success_file
- name: End if backup has already completed successfully
ansible.builtin.meta: end_host
when:
- rear_backup_success_file['stat']['exists'] | bool
- not rear_force_backup | default(false) | bool
- name: Perform ReaR Backup
when:
- bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | default(false) | bool
- not rear_backup_skip | default(false) | bool
block:
- name: Perform ReaR backup
ansible.builtin.include_role:
name: rhc.rear.rear_backup