diff --git a/tasks/hostname.yml b/tasks/hostname.yml index 4160a10..5162cc6 100644 --- a/tasks/hostname.yml +++ b/tasks/hostname.yml @@ -48,24 +48,24 @@ # ---------------------------------------------------------------------- # 3. STORAGE INFORMATION # ---------------------------------------------------------------------- - - name: Display Mounted Filesystems Summary (Safely) + - name: Display each mounted filesystem ansible.builtin.debug: msg: | - 💾 Mounted Filesystems - ========================= - {% for mount in ansible_mounts %} - 📍 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 %} + 💾 Mounted Filesystem ------------------------- - {% endfor %} + Mount Point : {{ item.mount }} + Device : {{ item.device }} + Fstype : {{ item.fstype }} + {% if 'size_used' in item and 'size_total' in item and item.fstype not in ['tmpfs', 'overlay', 'squashfs'] %} + Size Total : {{ (item.size_total | int // (1024 * 1024)) }} MB + Size Used : {{ (item.size_used | int // (1024 * 1024)) }} MB + Size Avail : {{ ((item.size_total | int - item.size_used | int) // (1024 * 1024)) }} MB + {% else %} + Size Info : Not Available + {% endif %} + loop: "{{ ansible_mounts }}" + when: item.fstype != 'tmpfs' and item.fstype != 'overlay' and item.fstype != 'squashfs' + # ----------------------------------------------------------------------