52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
---
|
|
- name: ReaR Restore Playbook
|
|
hosts: all
|
|
gather_facts: true
|
|
become: false
|
|
|
|
vars:
|
|
rear_backup_workflow: standalone
|
|
|
|
# We need to extract the contents of the archive, and then restore /etc/rear/local.conf
|
|
# after that THEN run mkrescue + rear_restore
|
|
|
|
# For /etc/rear/local.conf - first stat and see if exists; if exists use it
|
|
# else restore from archive
|
|
|
|
# How would this work if we restore from a differnt workflow?
|
|
# Won't we need to regenerate the local.cfg?
|
|
# Could we save the archive to etc-rear-{{ workflow }}.tar.gz and restore from that?
|
|
tasks:
|
|
- name: Check if configuration backup exists
|
|
ansible.builtin.stat:
|
|
path: "/root/etc-rear-backup-{{ rear_backup_workflow }}.tar.gz"
|
|
register: rear_config_backup_stat
|
|
|
|
- name: Create tmpdir and extract archive
|
|
when:
|
|
- rear_config_backup_stat['stat']['exists'] | bool
|
|
block:
|
|
- name: Create tmpdir
|
|
ansible.builtin.file:
|
|
path: /tmp/unarchive
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: Extract archive contents
|
|
ansible.builtin.unarchive:
|
|
remote_src: true
|
|
src: "/root/etc-rear-backup-{{ rear_backup_workflow }}.tar.gz"
|
|
dest: /tmp/unarchive
|
|
|
|
# - name: Import rear_vars role
|
|
# ansible.builtin.import_role:
|
|
# name: rhc.rear.rear_vars
|
|
|
|
# - name: Configure ReaR local.conf file
|
|
# ansible.builtin.include_role:
|
|
# name: rhc.rear.rear_local_cfg
|
|
|
|
# - name: Perform ReaR restore
|
|
# ansible.builtin.include_role:
|
|
# name: rhc.rear.rear_restore
|