Add restore functionality; update backup to include grub menu update
This commit is contained in:
parent
c8f40471cd
commit
8cea8158e9
4
roles/rear_backup/handlers/main.yml
Normal file
4
roles/rear_backup/handlers/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
- name: Update Grub
|
||||
ansible.builtin.command:
|
||||
cmd: grub2-mkconfig -o /boot/grub2/grub.cfg
|
@ -65,6 +65,13 @@
|
||||
changed_when: true
|
||||
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
|
||||
ansible.builtin.debug:
|
||||
msg: "ReaR backup has completed successfully."
|
||||
|
5
roles/rear_restore/roles/requirements.yml
Normal file
5
roles/rear_restore/roles/requirements.yml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: verified_reboot
|
||||
src: https://gitea.thezengarden.net/ansible_plays/verified_reboot.git
|
||||
scm: git
|
||||
version: main
|
@ -1,11 +1,7 @@
|
||||
---
|
||||
- name: Execute ReaR backup
|
||||
ansible.builtin.debug:
|
||||
msg: "Executing ReaR restore..."
|
||||
- name: Restore the server using ReaR backup
|
||||
ansible.builtin.command: "grub2-reboot 'Relax-and-Recover *** RESTORES RHEL7 ***'"
|
||||
|
||||
- name: Just checking...
|
||||
ansible.builtin.debug:
|
||||
msg: "Checking twice to be certain..."
|
||||
|
||||
|
||||
...
|
||||
- name: Reboot host
|
||||
ansible.builtin.import_role:
|
||||
name: verified_reboot
|
||||
|
Loading…
x
Reference in New Issue
Block a user