From 57abbccb047929bc6c0310de7877d525c2ee70ea Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Sun, 25 Dec 2022 20:54:50 +0100 Subject: [PATCH] Simplify disks.yml --- roles/os_config/tasks/disks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/os_config/tasks/disks.yml b/roles/os_config/tasks/disks.yml index d19ebb7..14e0f7d 100644 --- a/roles/os_config/tasks/disks.yml +++ b/roles/os_config/tasks/disks.yml @@ -25,7 +25,7 @@ loop: - "/dev/mapper/{{ hdd_name }}" - "/dev/mapper/{{ ssd_name }}" - when: mounted_devices.stdout_lines | select('search', item) | list | length == 0 + when: mounted_devices.stdout | regex_search(item) is none - name: Mount filesystems mount: @@ -39,7 +39,7 @@ path: "{{ hdd_mount_point }}" - dev: "/dev/mapper/{{ ssd_name }}" path: "{{ ssd_mount_point }}" - when: mounted_devices.stdout_lines | select('search', item.dev) | list | length == 0 + when: mounted_devices.stdout | regex_search(item.dev) is none - name: Check if swapfile is mounted shell: "swapon | grep -q '{{ ssd_mount_point }}/swapfile'"