Skip to content

Commit 3346f53

Browse files
committed
Terraform: volume/disk dimensions in human size
With this commit it is possible to specify a human dimension (i.e. "5 GB") for sizes.
1 parent 320b21e commit 3346f53

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

roles/terraform/templates/libvirt/vms.tf.j2

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ resource "libvirt_volume" "{{ disk.volume_id }}" {
1313
{% if disk.source is defined %}
1414
source = "{{ disk.source }}"
1515
{% endif %}
16-
{% if volume.size is defined %}
17-
size = "{{ disk.size }}"
16+
{% if disk.size is defined %}
17+
size = "{{ disk.size | human_to_bytes }}"
1818
{% endif %}
1919
format = "{{ disk.format | default('raw') }}"
2020

roles/terraform/templates/libvirt/volumes.tf.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ resource "libvirt_volume" "{{ volume.volume_id }}" {
1111
source = "{{ volume.source }}"
1212
{% endif %}
1313
{% if volume.size is defined %}
14-
size = "{{ volume.size }}"
14+
size = "{{ volume.size | human_to_bytes }}"
1515
{% endif %}
1616
format = "{{ volume.format | default('raw') }}"
1717

0 commit comments

Comments
 (0)