32 lines
770 B
YAML

---
- name: Create /etc/rear if it doesn't exist
ansible.builtin.file:
path: /etc/rear
state: directory
mode: "0755"
owner: root
group: root
- name: Update ReaR configuration file
ansible.builtin.template:
src: local.conf.j2
dest: /etc/rear/local.conf
owner: root
group: root
mode: "0600"
- name: ReaR Backup
block:
- name: Execute ReaR backup
ansible.builtin.command: rear -d -v mkbackup
changed_when: true
register: rear_mkbackup
rescue:
- name: ReaR backup failed
ansible.builtin.debug:
msg: "ReaR backup has failed. Please review the logs for any errors, and try again."
- name: ReaR backup success
ansible.builtin.debug:
msg: "ReaR backup has completed successfully."