Add success file detection; put stuff in block

This commit is contained in:
Chris Hammer 2025-02-28 15:44:14 -05:00
parent c5a3a86878
commit 9f069eb612

View File

@ -11,14 +11,28 @@
tasks: tasks:
- name: Include the backup role - name: Check for backup success file
ansible.builtin.include_role: ansible.builtin.stat:
name: ../roles/rear_backup path: "{{ standalone_backup_success_file }}"
register: standalone_backup_success
- name: End if backup for Bigboot already exists
ansible.builtin.meta: end_host
when:
- standalone_backup_success['stat']['exists'] | bool
- not rear_force_backup | default(false) | bool
- name: Perform ReaR Backup and write success log
when: when:
- ansible_distribution_major_version >= '7' - ansible_distribution_major_version >= '7'
- not rear_backup_skip | default(false) | bool - not rear_backup_skip | default(false) | bool
block:
- name: Include the backup role
ansible.builtin.include_role:
name: ../roles/rear_backup
- name: Verify ReaR backup log is present - name: Confirm ReaR backup log is present
ansible.builtin.stat: ansible.builtin.stat:
path: "/var/log/rear/rear-{{ ansible_hostname }}.log" path: "/var/log/rear/rear-{{ ansible_hostname }}.log"
register: rear_backup_log_stat register: rear_backup_log_stat