You've already forked deploy-vm
refine disk size validation and update Proxmox API format for extra disks
This commit is contained in:
+8
-1
@@ -64,7 +64,14 @@
|
||||
|
||||
- name: "deploy-vm | add extra disk '{{ _disk.disk }}' ({{ _disk.size }})"
|
||||
vars:
|
||||
_opts: "{{ _disk.storage | default(proxmox_storage) }}:0,size={{ _disk.size\
|
||||
# Proxmox API format : storage:SIZE_GB[,options]
|
||||
# SIZE_GB doit être un entier en GB (sans unité).
|
||||
# Formats acceptés : entier brut (20 → 20 GB), chaîne avec unité G ("20G") ou T ("2T").
|
||||
_size_gb: >-
|
||||
{{ (_disk.size | string)[:-1] | int * 1024 if (_disk.size | string)[-1] | upper == 'T'
|
||||
else (_disk.size | string)[:-1] | int if (_disk.size | string)[-1] | upper == 'G'
|
||||
else _disk.size | int }}
|
||||
_opts: "{{ _disk.storage | default(proxmox_storage) }}:{{ _size_gb\
|
||||
}}{{ ',ssd=1' if _disk.ssd | default(false) | bool else ''\
|
||||
}}{{ ',iothread=1' if _disk.iothread | default(false) | bool else ''\
|
||||
}}{{ ',backup=0' if not (_disk.backup | default(true) | bool) else ''\
|
||||
|
||||
Reference in New Issue
Block a user