fix 🐛: Update the hostname.yml playbook to display a summary of mounted filesystems safely, excluding tmpfs, overlay, and squashfs file systems.

Fixes the `hostname.yml` playbook to provide a more detailed and safe view of mounted filesystems by excluding certain types.
This commit is contained in:
2025-10-12 07:45:44 +02:00
parent 71e664f4df
commit 71a7c92d83

View File

@@ -48,16 +48,23 @@
# ----------------------------------------------------------------------
# 3. STORAGE INFORMATION
# ----------------------------------------------------------------------
- name: Show Mounted Filesystems
- name: Display Mounted Filesystems Summary (Safely)
ansible.builtin.debug:
msg: |
Mounted Filesystems:
{% for mount in ansible_mounts %}
- Mount Point : {{ mount.mount }}
💾 Mounted Filesystems
-------------------------
{% for mount in ansible_mounts and mount.fstype not in ['tmpfs', 'overlay', 'squashfs']%}
Mount Point : {{ mount.mount }}
Device : {{ mount.device }}
Fstype : {{ mount.fstype }}
Size Total : {{ mount.size_total | int // (1024*1024) }} MB
Size Used : {{ mount.size_used | int // (1024*1024) }} MB
{% if 'size_used' in mount and 'size_total' in mount and mount.fstype not in ['tmpfs', 'overlay', 'squashfs']%}
Size Total : {{ (mount.size_total | int // (1024 * 1024)) }} MB
Size Used : {{ (mount.size_used | int // (1024 * 1024)) }} MB
Size Avail : {{ ((mount.size_total | int - mount.size_used | int) // (1024 * 1024)) }} MB
{% else %}
Size Info : Not Available
{% endif %}
-------------------------
{% endfor %}
# ----------------------------------------------------------------------