From 7a1a33fa2bd1d44bbcf38a579ac724138a3a99d0 Mon Sep 17 00:00:00 2001 From: Bob Mader Date: Thu, 5 Oct 2023 07:40:06 -0500 Subject: [PATCH] remove lvm_snapshots_use_boom var and change lvm_snapshots_boot_backup default to false --- changelogs/fragments/minor-var-changes.yml | 3 +++ roles/lvm_snapshots/README.md | 21 +++++++-------------- roles/lvm_snapshots/defaults/main.yml | 3 +-- 3 files changed, 11 insertions(+), 16 deletions(-) create mode 100644 changelogs/fragments/minor-var-changes.yml diff --git a/changelogs/fragments/minor-var-changes.yml b/changelogs/fragments/minor-var-changes.yml new file mode 100644 index 0000000..6961237 --- /dev/null +++ b/changelogs/fragments/minor-var-changes.yml @@ -0,0 +1,3 @@ +minor_changes: + - Changed the lvm_snapshots_boot_backup var default to false + - Removed unimplemented lvm_snapshots_use_boom var from the docs diff --git a/roles/lvm_snapshots/README.md b/roles/lvm_snapshots/README.md index 51c52d4..d99ff4c 100644 --- a/roles/lvm_snapshots/README.md +++ b/roles/lvm_snapshots/README.md @@ -1,7 +1,7 @@ # lvm_snapshots role -The `lvm_snapshots` role is used to control the creation and rollback for a defined set of LVM snapshot volumes. In addition, it can optionally save the Grub configuration and image files under /boot, create a snapshot boom entry, and configure settings to enable the LVM snapshot autoextend capability. +The `lvm_snapshots` role is used to control the creation and rollback for a defined set of LVM snapshot volumes. In addition, it can optionally save the Grub configuration and image files under /boot and configure settings to enable the LVM snapshot autoextend capability. The role is designed to support the automation of RHEL in-place upgrades, but can also be used to reduce the risk of more mundane system maintenance activities. @@ -30,16 +30,12 @@ The `revert` action will verify that all snapshots in the set are still active s ### `lvm_snapshots_boot_backup` -Boolean to specify that the `create` action should preserve the Grub configuration and image files under /boot required for booting the default kernel. The preserved files will be restored with a `revert` action and they will be deleted with a `remove` action. The files are preserved in a compressed tar archive at `/root/boot-backup-.tgz`. Default is true. +Boolean to specify that the `create` action should preserve the Grub configuration and image files under /boot required for booting the default kernel. The preserved files will be restored with a `revert` action and they will be deleted with a `remove` action. The files are preserved in a compressed tar archive at `/root/boot-backup-.tgz`. Default is false. > **Warning** > > When automating RHEL in-place upgrades, do not perform a Grub to Grub2 migration as part of your upgrade playbook. It will invalidate your boot backup and cause a subsequent `revert` action to fail. For example, if you are using the [`upgrade`](https://github.com/redhat-cop/infra.leapp/tree/main/roles/upgrade#readme) role from the [`infra.leapp`](https://github.com/redhat-cop/infra.leapp) collection, do not set `update_grub_to_grub_2` to `true`. Grub to Grub2 migration should only be performed after the `remove` action has been performed to delete the snapshots and boot backup. -### `lvm_snapshots_use_boom` - -Boolean to specify that a boom profile will be created to add a Grub boot entry for the snapshot set. Default is true. - ### `lvm_snapshots_snapshot_autoextend_threshold` Configure the given `snapshot_autoextend_threshold` setting in lvm.conf before creating snapshots. @@ -72,7 +68,7 @@ To create thin provisioned snapshot of a thin provisioned volume, omit the `size ### Create snapshots -Perform space check and fail of there will not be enough space for all the snapshots in the set. If there is sufficient space, proceed to create snapshots for the listed logical volumes. Each snapshot will be sized to 20% of the origin volume size. Snapshot autoextend settings are configured to enable free space in the volume group to be allocated to any snapshot that may exceed 70% usage in the future. A boom profile will be created for the snapshot and required images files under /boot will be preserved. +Perform space check and fail of there will not be enough space for all the snapshots in the set. If there is sufficient space, proceed to create snapshots for the listed logical volumes. Each snapshot will be sized to 20% of the origin volume size. Snapshot autoextend settings are configured to enable free space in the volume group to be allocated to any snapshot that may exceed 70% usage in the future. Files under /boot will be preserved. ```yaml - hosts: all @@ -83,19 +79,18 @@ Perform space check and fail of there will not be enough space for all the snaps lvm_snapshots_snapshot_autoextend_threshold: 70 lvm_snapshots_snapshot_autoextend_percent: 20 lvm_snapshots_boot_backup: true - lvm_snapshots_use_boom: true lvm_snapshots_volumes: - vg: rootvg lv: root - size: 20%ORIGIN + size: 2G - vg: rootvg lv: var - size: 20%ORIGIN + size: 2G ``` ### Rollback -This playbook rolls back the host using the snapshots created above. After verifying that all snapshots are still valid, each logical volume in the snapshot set is merged. The image files under /boot will be restored and the boom profile will be deleted. Then the host will be rebooted. +This playbook rolls back the host using the snapshots created above. After verifying that all snapshots are still valid, each logical volume in the snapshot set is merged. The image files under /boot will be restored and then the host will be rebooted. ```yaml - hosts: all @@ -104,12 +99,11 @@ This playbook rolls back the host using the snapshots created above. After verif lvm_snapshots_set_name: ripu lvm_snapshots_action: revert lvm_snapshots_boot_backup: true - lvm_snapshots_use_boom: true ``` ### Commit -A commit playbook is used when users are comfortable the snapshots are not needed any longer. Each snapshot in the snapshot set is removed, the preserved image files under /boot are unlinked and the boom profile is deleted. +A commit playbook is used when users are comfortable the snapshots are not needed any longer. Each snapshot in the snapshot set is removed and the backed up image files from /boot are deleted. ```yaml - hosts: all @@ -118,5 +112,4 @@ A commit playbook is used when users are comfortable the snapshots are not neede lvm_snapshots_set_name: ripu lvm_snapshots_action: remove lvm_snapshots_boot_backup: true - lvm_snapshots_use_boom: true ``` diff --git a/roles/lvm_snapshots/defaults/main.yml b/roles/lvm_snapshots/defaults/main.yml index 341f45d..8d1051d 100644 --- a/roles/lvm_snapshots/defaults/main.yml +++ b/roles/lvm_snapshots/defaults/main.yml @@ -1,3 +1,2 @@ lvm_snapshots_volumes: [] -lvm_snapshots_use_boom: true -lvm_snapshots_boot_backup: true +lvm_snapshots_boot_backup: false