Tweaks
All checks were successful
Ansible Lint Pipeline / Ansible-Development-Pipeline (ansible-dev-centos) (push) Successful in 46s
All checks were successful
Ansible Lint Pipeline / Ansible-Development-Pipeline (ansible-dev-centos) (push) Successful in 46s
This commit is contained in:
@ -12,22 +12,31 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
date_now: "{{ ansible_date_time['date'] }}"
|
date_now: "{{ ansible_date_time['date'] }}"
|
||||||
file_date: "{{ '%Y-%m-%d' | strftime(file_details['stat']['mtime']) }}"
|
file_date: "{{ '%Y-%m-%d' | strftime(file_details['stat']['mtime']) }}"
|
||||||
when:
|
|
||||||
- file_details['stat']['exists'] | bool
|
|
||||||
|
|
||||||
- name: Compare Dates to delete based on our 2 days retention policy
|
- name: Debug dates
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ item }}"
|
||||||
|
verbosity: 1
|
||||||
|
loop:
|
||||||
|
- "{{ date_now }}"
|
||||||
|
- "{{ file_date }}"
|
||||||
|
|
||||||
|
- name: Compare dates to delete based on our retention policy
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
file_status: "{{ ((date_now | to_datetime('%Y-%m-%d')) - (file_date | to_datetime('%Y-%m-%d'))).days }}"
|
file_status: "{{ ((date_now | to_datetime('%Y-%m-%d')) - (file_date | to_datetime('%Y-%m-%d'))).days }}"
|
||||||
when:
|
|
||||||
- file_details['stat']['exists'] | bool
|
|
||||||
|
|
||||||
- name: Include Cleanup if the ReaR file is created 6 days back
|
- name: Debug file_status
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ file_status }}"
|
||||||
|
verbosity: 1
|
||||||
|
|
||||||
|
- name: Include cleanup tasks due to ReaR backup age
|
||||||
ansible.builtin.include_tasks: cleanup.yml
|
ansible.builtin.include_tasks: cleanup.yml
|
||||||
when:
|
when:
|
||||||
- not (file_status|int <= 6)
|
- file_status|int >= 6
|
||||||
|
|
||||||
- name: Print Msg if ReaR file doesnt exist
|
- name: Print message if ReaR file doesnt exist
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "The ReaR files don't exist on this server."
|
msg: "The ReaR files don't exist on this server."
|
||||||
when:
|
when:
|
||||||
- not file_details['stat']['exists'] | bool
|
- not file_details['stat']['exists'] | bool
|
||||||
|
@ -16,7 +16,7 @@ rear_vars_tmpdir: /var/tmp/rear_restore
|
|||||||
# - rear_backup
|
# - rear_backup
|
||||||
rear_vars_success_file_path: "/var/IPE/IPU/el7to8"
|
rear_vars_success_file_path: "/var/IPE/IPU/el7to8"
|
||||||
|
|
||||||
rear_vars_grub_label: 'Relax-and-Recover *** RESTORES RHEL7 ***'
|
rear_vars_grub_label: 'Relax-and-Recover'
|
||||||
rear_vars_grub_conf: /etc/grub.d/45_rear
|
rear_vars_grub_conf: /etc/grub.d/45_rear
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user