From cb3f36a040e102c7ed3bf0647345f6cb6d3d41b9 Mon Sep 17 00:00:00 2001 From: Sandwich Date: Thu, 31 Oct 2024 14:23:55 +0100 Subject: [PATCH] Add umount for non RHEL systems --- roles/cleanup/tasks/main.yml | 6 ++++++ roles/partitioning/tasks/main.yml | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/roles/cleanup/tasks/main.yml b/roles/cleanup/tasks/main.yml index 258517d..a796f95 100644 --- a/roles/cleanup/tasks/main.yml +++ b/roles/cleanup/tasks/main.yml @@ -1,4 +1,10 @@ --- +- name: Unmount /mnt recursively + when: os not in ['rhel8', 'rhel9'] + ansible.builtin.command: umount -R /mnt + changed_when: result.rc == 0 + register: result + - name: Setup Cleanup when: hypervisor == "proxmox" delegate_to: localhost diff --git a/roles/partitioning/tasks/main.yml b/roles/partitioning/tasks/main.yml index 66b6933..8668434 100644 --- a/roles/partitioning/tasks/main.yml +++ b/roles/partitioning/tasks/main.yml @@ -107,10 +107,10 @@ - name: Mount filesystems block: - name: Mount filesystems and subvolumes - when: + when: - cis | bool or (not cis and (item.path == '/var/log' and filesystem == 'btrfs') or (item.path not in ['/home', '/var', '/var/log', '/var/log/audit'])) - - not (item.path == '/swap' and filesystem != 'btrfs') + - not (item.path == '/swap' and filesystem != 'btrfs') ansible.posix.mount: path: /mnt{{ item.path }} src: "{{ 'UUID=' + (main_uuid.stdout if filesystem == 'btrfs' else item.uuid) }}"