Updates to Bigboot ReaR based on updates to ReaR
This commit is contained in:
parent
3c05c4cd5d
commit
212a686c90
@ -9,43 +9,30 @@
|
|||||||
- bigboot_vars.yml
|
- bigboot_vars.yml
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Import rear_vars role
|
||||||
|
ansible.builtin.import_role:
|
||||||
|
name: rhc.rear.rear_vars
|
||||||
|
|
||||||
- name: Fetch the template name from NFS exports
|
- name: Fetch the template name from NFS exports
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
job_template_name: "{{ nfs_exports_template_name }}"
|
job_template_name: "{{ nfs_exports_template_name }}"
|
||||||
|
|
||||||
- name: Check for backup success file for Bigboot
|
- name: Check for previous backup completion
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ bigboot_backup_success_file }}"
|
path: "{{ rear_backup_success_file_path }}/{{ rear_backup_workflow }}_rear_success"
|
||||||
register: bigboot_backup_success
|
register: rear_backup_success_file
|
||||||
|
|
||||||
- name: End if backup for Bigboot already exists
|
- name: End if backup has already completed successfully
|
||||||
ansible.builtin.meta: end_host
|
ansible.builtin.meta: end_host
|
||||||
when:
|
when:
|
||||||
- bigboot_backup_success['stat']['exists'] | bool
|
- rear_backup_success_file['stat']['exists'] | bool
|
||||||
- not rear_force_backup | default(false) | bool
|
- not rear_force_backup | default(false) | bool
|
||||||
|
|
||||||
- name: Perform ReaR Backup and write success log
|
- name: Perform ReaR Backup
|
||||||
when:
|
when:
|
||||||
- bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | default(false) | bool
|
- bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | default(false) | bool
|
||||||
- not rear_backup_skip | default(false) | bool
|
- not rear_backup_skip | default(false) | bool
|
||||||
block:
|
block:
|
||||||
- name: Perform ReaR backup # noqa var-naming
|
- name: Perform ReaR backup
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: rhc.rear.rear_backup
|
name: rhc.rear.rear_backup
|
||||||
vars:
|
|
||||||
rear_nfs_backup_share: "{{ bigboot_nfs_backup_share }}"
|
|
||||||
|
|
||||||
- name: Check and archive ReaR backup log file
|
|
||||||
ansible.builtin.import_tasks: tasks/backup_rear_log.yml
|
|
||||||
|
|
||||||
- name: Create success file directory if not present
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ bigboot_backup_success_path }}"
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
|
|
||||||
- name: Create Bigboot backup success file
|
|
||||||
ansible.builtin.copy:
|
|
||||||
dest: "{{ bigboot_backup_success_file }}"
|
|
||||||
content: "success\n"
|
|
||||||
mode: "0644"
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: Execute a ReaR restore and restore system to pre-Bigboot state
|
- name: Execute ReaR restore
|
||||||
hosts: all
|
hosts: all
|
||||||
become: true
|
become: true
|
||||||
gather_facts: true
|
gather_facts: true
|
||||||
@ -9,8 +9,8 @@
|
|||||||
- bigboot_vars.yml
|
- bigboot_vars.yml
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Shrink the logical volume to support /boot expansion
|
- name: Restore from ReaR backup
|
||||||
ansible.builtin.import_role:
|
ansible.builtin.include_role:
|
||||||
name: rhc.rear.rear_restore
|
name: rhc.rear.rear_restore
|
||||||
|
|
||||||
- name: Cleanup from any previous executions
|
- name: Cleanup from any previous executions
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Check for ReaR backup log file presence
|
|
||||||
ansible.builtin.stat:
|
|
||||||
path: "/var/log/rear/rear-{{ ansible_hostname }}.log"
|
|
||||||
register: bigboot_rear_log
|
|
||||||
|
|
||||||
- name: Backup ReaR log file
|
|
||||||
when:
|
|
||||||
- bigboot_rear_log['stat']['exists']
|
|
||||||
block:
|
|
||||||
- name: Copy ReaR log file to backup location
|
|
||||||
ansible.builtin.copy:
|
|
||||||
src: "/var/log/rear/rear-{{ ansible_hostname }}.log"
|
|
||||||
dest: "/var/log/rear-{{ ansible_hostname }}-{{ '%Y-%m-%d' | strftime(bigboot_rear_log['stat']['mtime']) }}.log"
|
|
||||||
mode: "0644"
|
|
||||||
backup: true
|
|
||||||
remote_src: true
|
|
||||||
|
|
||||||
- name: Remove ReaR log file
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "/var/log/rear/rear-{{ ansible_hostname }}.log"
|
|
||||||
state: absent
|
|
@ -6,8 +6,5 @@ bigboot_size_target: 1G
|
|||||||
# Filename of disabled services log:
|
# Filename of disabled services log:
|
||||||
bigboot_disabled_services_log: /var/IPE/IPU/el7to8/bigboot_disabled_services.log
|
bigboot_disabled_services_log: /var/IPE/IPU/el7to8/bigboot_disabled_services.log
|
||||||
|
|
||||||
# ReaR Backup Variables
|
# Define ReaR backup workflow:
|
||||||
bigboot_backup_success_path: "/var/IPE/IPU/el7to8"
|
rear_backup_workflow: bigboot
|
||||||
bigboot_backup_success_file: "{{ bigboot_backup_success_path }}/bigboot_rear_success"
|
|
||||||
bigboot_nfs_backup_share: "/backups/bigboot"
|
|
||||||
bigboot_nfs_backup_share_fsid: 20
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user