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