From 70672982e846b53573eaf774d66dcb782d557543 Mon Sep 17 00:00:00 2001 From: Bob Mader Date: Wed, 4 Oct 2023 17:11:35 -0500 Subject: [PATCH] ensure tar and gzip are present (#17) --- changelogs/fragments/tar-present.yml | 2 ++ roles/lvm_snapshots/tasks/create.yml | 7 +++++++ roles/lvm_snapshots/tasks/revert.yml | 7 +++++++ 3 files changed, 16 insertions(+) create mode 100644 changelogs/fragments/tar-present.yml diff --git a/changelogs/fragments/tar-present.yml b/changelogs/fragments/tar-present.yml new file mode 100644 index 0000000..b8d0614 --- /dev/null +++ b/changelogs/fragments/tar-present.yml @@ -0,0 +1,2 @@ +bugfixes: + - Add task to ensure tar package is present diff --git a/roles/lvm_snapshots/tasks/create.yml b/roles/lvm_snapshots/tasks/create.yml index bd93b74..ba37d11 100644 --- a/roles/lvm_snapshots/tasks/create.yml +++ b/roles/lvm_snapshots/tasks/create.yml @@ -26,6 +26,13 @@ size: "{{ item.size | default(omit) }}" loop: "{{ lvm_snapshots_volumes }}" +- name: Required packages are present + ansible.builtin.package: + name: + - gzip + - tar + state: present + - name: Create boot backup community.general.archive: format: gz diff --git a/roles/lvm_snapshots/tasks/revert.yml b/roles/lvm_snapshots/tasks/revert.yml index 4b2c83b..8cdd8dd 100644 --- a/roles/lvm_snapshots/tasks/revert.yml +++ b/roles/lvm_snapshots/tasks/revert.yml @@ -2,6 +2,13 @@ ansible.builtin.include_tasks: verify_snapshot_active.yml loop: "{{ lvm_snapshots_snapshots }}" +- name: Required packages are present + ansible.builtin.package: + name: + - gzip + - tar + state: present + - name: Restore boot backup ansible.builtin.unarchive: remote_src: true