New stuff

This commit is contained in:
2025-01-08 17:20:07 -05:00
parent fa1b5cce00
commit 7a93d8d72a
4 changed files with 84 additions and 5 deletions

29
check_device2.yml Normal file
View File

@ -0,0 +1,29 @@
---
- name: Something
hosts: bigboot
become: false
gather_facts: true
vars:
shrink_lv_devices:
- device: "/dev/mapper/system-root"
size: 81229615104
tasks:
- name: Get the mount point info
ansible.builtin.set_fact:
shrink_lv_mount_info: "{{ ansible_facts.mounts | selectattr('device', 'equalto', shrink_lv_devices[0].device) }}"
- name: Debug shrink_lv_mount_info
ansible.builtin.debug:
var: shrink_lv_mount_info
# - name: Assert that the mount point exists
# ansible.builtin.assert:
# that: (shrink_lv_mount_info | length) >= 1
# fail_msg: "Mount point {{ shrink_lv_devices[0].device }} does not exist"
# - name: Assert that the filesystem is supported
# ansible.builtin.assert:
# that: shrink_lv_mount_info[0].fstype in ['ext4']
# fail_msg: "Unsupported filesystem '{{ shrink_lv_mount_info[0].fstype }}' on '{{ shrink_lv_devices[0].device }}'"