Add success file creation; this will need further work based on notes but we can test from here

This commit is contained in:
Chris Hammer 2025-02-28 15:37:02 -05:00
parent e11710f504
commit c5a3a86878

View File

@ -5,6 +5,10 @@
gather_facts: true gather_facts: true
strategy: free strategy: free
vars:
standalone_backup_success_path: "/var/log/IPE/IPU/el7to8"
standalone_backup_success_file: "{{ standalone_backup_success_path }}/standalone_rear_success"
tasks: tasks:
- name: Include the backup role - name: Include the backup role
@ -19,7 +23,7 @@
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
- name: Backup ReaR log file - name: Backup ReaR log file and create success file
when: when:
- rear_backup_log_stat['stat']['exists'] - rear_backup_log_stat['stat']['exists']
block: block:
@ -35,3 +39,15 @@
ansible.builtin.file: ansible.builtin.file:
path: "/var/log/rear/rear-{{ ansible_hostname }}.log" path: "/var/log/rear/rear-{{ ansible_hostname }}.log"
state: absent state: absent
- name: Create success file directory if not present
ansible.builtin.file:
path: "{{ standalone_backup_success_path }}"
state: directory
mode: "0755"
- name: Create backup success file
ansible.builtin.copy:
dest: "{{ standalone_backup_success_file }}"
content: "success\n"
mode: "0644"