From 3dc52d7f616bf7e673f40ccb589b57ba11662f6e Mon Sep 17 00:00:00 2001 From: "mhorak@totalservice.cz" Date: Thu, 14 Aug 2025 16:25:08 +0200 Subject: [PATCH] a --- www-windows-check-free-disk-space.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www-windows-check-free-disk-space.yaml b/www-windows-check-free-disk-space.yaml index 2afda53..f914899 100644 --- a/www-windows-check-free-disk-space.yaml +++ b/www-windows-check-free-disk-space.yaml @@ -32,14 +32,20 @@ @{n='SizeBytes';e={$_.Size}}, @{n='SizeMB';e={[math]::Round($_.Size/1MB,2)}}, GptType, Type ) + $parts = @($parts) $parts | ConvertTo-Json -Compress -Depth 4 register: winre_raw changed_when: false - - name: Parse JSON to a list + - name: Parse JSON (string → object) ansible.builtin.set_fact: winre_parts: "{{ (winre_raw.output | join('') | trim | default('[]')) | from_json }}" + - name: Normalize to list + ansible.builtin.set_fact: + winre_parts: "{{ [winre_parts] }}" + when: winre_parts is mapping + - name: Show Recovery partition sizes ansible.builtin.debug: msg: "Disk {{ item.DiskNumber }}, Part {{ item.PartitionNumber }}, Size: {{ item.SizeMB }} MB ({{ item.SizeBytes }} bytes)"