Tweaks
All checks were successful
Ansible Lint Pipeline / Ansible-Development-Pipeline (ansible-dev-centos) (push) Successful in 46s

This commit is contained in:
2025-09-26 14:32:03 -04:00
parent 056b19c327
commit cfbf138c17
2 changed files with 22 additions and 13 deletions

View File

@ -12,21 +12,30 @@
ansible.builtin.set_fact:
date_now: "{{ ansible_date_time['date'] }}"
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:
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
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:
msg: "The ReaR files don't exist on this server."
when:

View File

@ -16,7 +16,7 @@ rear_vars_tmpdir: /var/tmp/rear_restore
# - rear_backup
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