--- - 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 backup success file for Bigboot ansible.builtin.stat: path: "{{ bigboot_backup_success_file }}" register: bigboot_backup_success - name: End if backup for Bigboot already exists ansible.builtin.meta: end_host when: - bigboot_backup_success['stat']['exists'] | bool - not rear_force_backup | default(false) | bool - 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 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: Copy ReaR log file to backup location ansible.builtin.copy: src: "/var/log/rear/rear-{{ ansible_hostname }}.log" dest: "/var/log/rear-{{ ansible_hostname }}-{{ '%Y-%m-%d' | strftime(old_rear_log['stat']['mtime']) }}.log" mode: "0644" backup: true remote_src: true - name: Remove ReaR log file ansible.builtin.file: path: "/var/log/rear/rear-{{ ansible_hostname }}.log" state: absent - 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"