Testing stuff

This commit is contained in:
Chris Hammer 2025-02-28 00:39:45 -05:00
parent 5a0a8148d4
commit cd16954ae5

View File

@ -6,7 +6,7 @@
strategy: free
vars:
rear_backup_success_file: "/var/log/IPE/IPU/bigboot_rear_success"
rear_backup_success_file: "/var/log/IPE/IPU/el7to8/bigboot_rear_success"
tasks:
- name: Check for backup log presence
@ -18,29 +18,42 @@
when:
- rear_backup_log_presence['stat']['exists'] | bool
block:
# - name: Validate ReaR backup completion
# ansible.builtin.command:
# cmd: "grep 'Finished running mkbackup workflow' /var/log/rear/rear-{{ ansible_hostname }}.log"
# changed_when: false
# ignore_errors: true
# register: validate_backup_log
- name: Validate ReaR backup completion
ansible.builtin.command:
cmd: "grep 'Finished running mkbackup workflow' /var/log/rear/rear-{{ ansible_hostname }}.log"
changed_when: false
ignore_errors: true
register: validate_backup_log
failed_when: validate_backup_log['rc'] not in [0, 1]
- name: Debug validate_backup_log
ansible.builtin.debug:
var: validate_backup_log
verbosity: 1
when:
- validate_backup_log['rc'] == 0
- name: Create log file directory if not present
ansible.builtin.file:
path: "{{ rear_backup_success_path }}"
state: directory
mode: "0755"
- name: Debug validate_backup_log
ansible.builtin.debug:
msg: "p00p"
when:
- validate_backup_log['rc'] == 1
- name: Create Bigboot backup success file
ansible.builtin.copy:
dest: "{{ rear_backup_success_file }}"
content: "success\n"
mode: "0644"
# - name: Create log file directory if not present
# ansible.builtin.file:
# path: "{{ rear_backup_success_path }}"
# state: directory
# mode: "0755"
# - name: Create Bigboot backup success file
# ansible.builtin.copy:
# dest: "{{ rear_backup_success_file }}"
# content: "success\n"
# mode: "0644"
rescue:
- name: No backup log found
ansible.builtin.debug: