Add success file creation; this will need further work based on notes but we can test from here
This commit is contained in:
parent
e11710f504
commit
c5a3a86878
@ -5,6 +5,10 @@
|
||||
gather_facts: true
|
||||
strategy: free
|
||||
|
||||
vars:
|
||||
standalone_backup_success_path: "/var/log/IPE/IPU/el7to8"
|
||||
standalone_backup_success_file: "{{ standalone_backup_success_path }}/standalone_rear_success"
|
||||
|
||||
|
||||
tasks:
|
||||
- name: Include the backup role
|
||||
@ -19,7 +23,7 @@
|
||||
path: "/var/log/rear/rear-{{ ansible_hostname }}.log"
|
||||
register: rear_backup_log_stat
|
||||
|
||||
- name: Backup ReaR log file
|
||||
- name: Backup ReaR log file and create success file
|
||||
when:
|
||||
- rear_backup_log_stat['stat']['exists']
|
||||
block:
|
||||
@ -35,3 +39,15 @@
|
||||
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: "{{ 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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user