datavol: Handle undefined logical_volumes

This fixes an `Unable to look up a name or access an atribute in
template string` error when applying the `datavol.yml` playbook for a
machine that does not define any LVM logical volumes.
unifi-restore
Dustin 2025-07-28 16:51:04 -05:00
parent 59d17bf3f4
commit bf33c2ab7c
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@
lv: '{{ item.1.name }}'
vg: '{{ item.0.key }}'
size: '{{ item.1.size }}'
loop: '{{ logical_volumes | dict2items | subelements("value.lvs") }}'
loop: '{{ logical_volumes | d({}) | dict2items | subelements("value.lvs") }}'
loop_control:
label: '{{ item.0.key }}/{{ item.1.name }}'
tags: