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:
@@ -20,7 +20,7 @@
|
||||
{% for cpu in ansible_processor %}
|
||||
- {{ cpu }}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# 2. NETWORK INFORMATION
|
||||
# ----------------------------------------------------------------------
|
||||
@@ -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 }}
|
||||
Device : {{ mount.device }}
|
||||
Fstype : {{ mount.fstype }}
|
||||
Size Total : {{ mount.size_total | int // (1024*1024) }} MB
|
||||
Size Used : {{ mount.size_used | int // (1024*1024) }} MB
|
||||
💾 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 }}
|
||||
{% 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 %}
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user