shrink_lv/bigboot_rear_backup.yml
2025-02-27 20:34:54 -05:00

44 lines
1.3 KiB
YAML

---
- name: ReaR Backup Playbook
hosts: all
become: true
gather_facts: true
strategy: free
vars_files:
- bigboot_vars.yml
tasks:
- name: Fetch the template name from NFS exports
ansible.builtin.set_fact:
job_template_name: "{{ nfs_exports_template_name }}"
- name: Check for previous backup for Bigboot
ansible.builtin.stat:
path: "{{ bigboot_backup_success_file }}"
register: bigboot_backup_success
- name: Perform ReaR Backup and write success log
when:
- bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | default(false) | bool
- not rear_backup_skip | default(false) | bool
- not bigboot_backup_success['stat']['exists'] | bool
block:
- name: Perform ReaR backup # noqa var-naming
ansible.builtin.include_role:
name: rhc.rear.rear_backup
vars:
rear_nfs_export_share: "{{ bigboot_nfs_backup_share }}"
- name: Create success file directory if not present
ansible.builtin.file:
path: "{{ bigboot_backup_success_path }}"
state: directory
mode: "0755"
- name: Create Bigboot backup success file
ansible.builtin.copy:
dest: "{{ bigboot_backup_success_file }}"
content: "success\n"
mode: "0644"