Optimizations

This commit is contained in:
2025-03-03 20:15:51 -05:00
parent 589da360dd
commit 0ff9e4410a
6 changed files with 26 additions and 18 deletions

View File

@ -5,21 +5,16 @@
gather_facts: true
strategy: free
vars:
standalone_backup_success_path: "/var/IPE/IPU/el7to8"
standalone_backup_success_file: "{{ standalone_backup_success_path }}/standalone_rear_success"
tasks:
- name: Check for previous backup completion
ansible.builtin.stat:
path: "{{ standalone_backup_success_file }}"
register: standalone_backup_success
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:
- standalone_backup_success['stat']['exists'] | bool
- rear_backup_success_file['stat']['exists'] | bool
- not rear_force_backup | default(false) | bool
- name: Perform ReaR Backup and write success log
@ -30,6 +25,8 @@
- name: Include the backup role
ansible.builtin.include_role:
name: rhc.rear.rear_backup
vars:
rear_backup_workflow: standalone
- name: Confirm ReaR backup log is present
ansible.builtin.stat:
@ -55,12 +52,12 @@
- name: Create success file directory if not present
ansible.builtin.file:
path: "{{ standalone_backup_success_path }}"
path: "{{ rear_backup_success_file_path }}"
state: directory
mode: "0755"
- name: Create backup success file
ansible.builtin.copy:
dest: "{{ standalone_backup_success_file }}"
dest: "{{ rear_backup_success_file_path }}/{{ rear_backup_workflow }}_rear_success"
content: "success\n"
mode: "0644"