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 %}
|
{% for cpu in ansible_processor %}
|
||||||
- {{ cpu }}
|
- {{ cpu }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# 2. NETWORK INFORMATION
|
# 2. NETWORK INFORMATION
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
@@ -48,16 +48,23 @@
|
|||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# 3. STORAGE INFORMATION
|
# 3. STORAGE INFORMATION
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
- name: Show Mounted Filesystems
|
- name: Display Mounted Filesystems Summary (Safely)
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: |
|
msg: |
|
||||||
Mounted Filesystems:
|
💾 Mounted Filesystems
|
||||||
{% for mount in ansible_mounts %}
|
-------------------------
|
||||||
- Mount Point : {{ mount.mount }}
|
{% for mount in ansible_mounts and mount.fstype not in ['tmpfs', 'overlay', 'squashfs']%}
|
||||||
Device : {{ mount.device }}
|
Mount Point : {{ mount.mount }}
|
||||||
Fstype : {{ mount.fstype }}
|
Device : {{ mount.device }}
|
||||||
Size Total : {{ mount.size_total | int // (1024*1024) }} MB
|
Fstype : {{ mount.fstype }}
|
||||||
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 %}
|
{% endfor %}
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user