From f0acda953ca3d8ab1c17f5c9e009458168fe6f82 Mon Sep 17 00:00:00 2001 From: Juan Larriba Date: Mon, 25 Jan 2021 13:24:52 +0100 Subject: [PATCH] Option to remove the self-installed ReaR cron task By default, the ReaR rpm installs a cronjob on /etc/cron.d/rear with a default programming. This programming runs a backup job at 1:30AM every day. During this automatic backup, the services are not appropiately paused. This causes the created backup to have non-valid data. As the most recent backup overwrites the older ones, this deletes the "good" backup taken at operator's discretion with a new one that cannot be used to restore the control plane state. This change aims to optionally disable this default rpm behaviour. Closes-Bug: #1912764 Change-Id: I2582c1ba74ae115a94ecb4524ba34e79ea5b43e8 --- .../roles/backup_and_restore/defaults/main.yml | 3 +++ .../roles/backup_and_restore/tasks/setup_rear.yml | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/tripleo_ansible/roles/backup_and_restore/defaults/main.yml b/tripleo_ansible/roles/backup_and_restore/defaults/main.yml index 91b72e534..ac209ced5 100644 --- a/tripleo_ansible/roles/backup_and_restore/defaults/main.yml +++ b/tripleo_ansible/roles/backup_and_restore/defaults/main.yml @@ -72,3 +72,6 @@ tripleo_backup_and_restore_ceph_path: "/var/lib/ceph" # If there is a firewalld active, setup the zone where the NFS server ports need to be opened tripleo_backup_and_restore_firewalld_zone: "libvirt" + +# The ReaR rpm installs a cronjob at 1:30 each day by default. This variable deactivate that behaviour. +tripleo_backup_and_restore_remove_default_cronjob: true diff --git a/tripleo_ansible/roles/backup_and_restore/tasks/setup_rear.yml b/tripleo_ansible/roles/backup_and_restore/tasks/setup_rear.yml index 5ec42a573..7719b8a93 100644 --- a/tripleo_ansible/roles/backup_and_restore/tasks/setup_rear.yml +++ b/tripleo_ansible/roles/backup_and_restore/tasks/setup_rear.yml @@ -40,6 +40,15 @@ tags: - bar_setup_rear +- name: Remove ReaR rpm default cron programming + become: true + file: + path: /etc/cron.d/rear + state: absent + when: tripleo_backup_and_restore_remove_default_cronjob | bool + tags: + - bar_setup_rear + - name: Get local hostname command: hostname register: tripleo_backup_and_restore_hostname