Add restore functionality; update backup to include grub menu update

This commit is contained in:
Chris Hammer 2025-02-24 15:27:02 -05:00
parent c8f40471cd
commit 8cea8158e9
4 changed files with 21 additions and 9 deletions

View File

@ -0,0 +1,4 @@
---
- name: Update Grub
ansible.builtin.command:
cmd: grub2-mkconfig -o /boot/grub2/grub.cfg

View File

@ -65,6 +65,13 @@
changed_when: true changed_when: true
register: rear_mkbackup register: rear_mkbackup
- name: Update ReaR Grub menu item
ansible.builtin.lineinfile:
path: "{{ rear_grub_conf }}"
line: "menuentry '{{ rear_grub_label }}' --class os {"
state: present
notify: Update Grub
- name: ReaR backup success - name: ReaR backup success
ansible.builtin.debug: ansible.builtin.debug:
msg: "ReaR backup has completed successfully." msg: "ReaR backup has completed successfully."

View File

@ -0,0 +1,5 @@
---
- name: verified_reboot
src: https://gitea.thezengarden.net/ansible_plays/verified_reboot.git
scm: git
version: main

View File

@ -1,11 +1,7 @@
--- ---
- name: Execute ReaR backup - name: Restore the server using ReaR backup
ansible.builtin.debug: ansible.builtin.command: "grub2-reboot 'Relax-and-Recover *** RESTORES RHEL7 ***'"
msg: "Executing ReaR restore..."
- name: Just checking... - name: Reboot host
ansible.builtin.debug: ansible.builtin.import_role:
msg: "Checking twice to be certain..." name: verified_reboot
...