Simplify disks.yml

This commit is contained in:
Sam A. 2022-12-25 20:54:50 +01:00
parent a65f92c8c4
commit 57abbccb04
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA

View file

@ -25,7 +25,7 @@
loop: loop:
- "/dev/mapper/{{ hdd_name }}" - "/dev/mapper/{{ hdd_name }}"
- "/dev/mapper/{{ ssd_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 - name: Mount filesystems
mount: mount:
@ -39,7 +39,7 @@
path: "{{ hdd_mount_point }}" path: "{{ hdd_mount_point }}"
- dev: "/dev/mapper/{{ ssd_name }}" - dev: "/dev/mapper/{{ ssd_name }}"
path: "{{ ssd_mount_point }}" 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 - name: Check if swapfile is mounted
shell: "swapon | grep -q '{{ ssd_mount_point }}/swapfile'" shell: "swapon | grep -q '{{ ssd_mount_point }}/swapfile'"