summaryrefslogtreecommitdiff
path: root/roles/vm/guest/define/templates/libvirt-domain.xml.j2
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2022-01-01 20:19:56 +0100
committerChristian Pointner <equinox@spreadspace.org>2022-01-01 20:19:56 +0100
commitd90144d2190009f8bd121cb8f773a9209500f034 (patch)
tree2d258279d2179afc58fd91c741e0b5fa56246c9f /roles/vm/guest/define/templates/libvirt-domain.xml.j2
parentMerge branch 'topic/revamp-openwrt-imag-gen' (diff)
in-place variable cooking
Diffstat (limited to 'roles/vm/guest/define/templates/libvirt-domain.xml.j2')
-rw-r--r--roles/vm/guest/define/templates/libvirt-domain.xml.j218
1 files changed, 9 insertions, 9 deletions
diff --git a/roles/vm/guest/define/templates/libvirt-domain.xml.j2 b/roles/vm/guest/define/templates/libvirt-domain.xml.j2
index 2287dd0b..0430229b 100644
--- a/roles/vm/guest/define/templates/libvirt-domain.xml.j2
+++ b/roles/vm/guest/define/templates/libvirt-domain.xml.j2
@@ -1,8 +1,8 @@
<domain type='kvm'>
<name>{{ inventory_hostname }}</name>
- <memory>{{ ((install_cooked.vm.memory | human_to_bytes) / 1024) | int }}</memory>
- <currentMemory>{{ ((install_cooked.vm.memory | human_to_bytes) / 1024) | int }}</currentMemory>
- <vcpu>{{ install_cooked.vm.numcpus }}</vcpu>
+ <memory>{{ ((install.vm.memory | human_to_bytes) / 1024) | int }}</memory>
+ <currentMemory>{{ ((install.vm.memory | human_to_bytes) / 1024) | int }}</currentMemory>
+ <vcpu>{{ install.vm.numcpus }}</vcpu>
<os>
<type arch='x86_64' machine='q35'>hvm</type>
{% if vm_define_installer %}
@@ -50,18 +50,18 @@
</disk>
{% endif %}
-{% if install_cooked.disks %}
-{% if 'scsi' in install_cooked.disks %}
+{% if install.disks %}
+{% if 'scsi' in install.disks %}
<controller type='scsi' index='0' model='virtio-scsi'/>
{% endif %}
{% for bus in ['virtio', 'scsi'] %}
-{% for device, src in (install_cooked.disks[bus] | default({})).items() %}
+{% for device, src in (install.disks[bus] | default({})).items() %}
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' discard='unmap'/>
{% if src.type == 'lvm' %}
<source dev='/dev/mapper/{{ src.vg | replace('-', '--') }}-{{ src.lv | replace('-', '--') }}'/>
{% elif src.type == 'zfs' %}
- <source dev='/dev/zvol/{{ vm_host_cooked.zfs[src.backend | default('default')].pool }}/{{ vm_host_cooked.zfs[src.backend | default('default')].name }}/{{ inventory_hostname }}/{{ src.name }}'/>
+ <source dev='/dev/zvol/{{ vm_host.zfs[src.backend | default('default')].pool }}/{{ vm_host.zfs[src.backend | default('default')].name }}/{{ inventory_hostname }}/{{ src.name }}'/>
{% elif src.type == 'blockdev' %}
<source dev='{{ src.path }}'/>
{% endif %}
@@ -71,8 +71,8 @@
{% endfor %}
{% endif %}
-{% if install_cooked.interfaces %}
-{% for if in install_cooked.interfaces %}
+{% if install.interfaces %}
+{% for if in install.interfaces %}
<interface type='bridge'>
{% if 'mac' in if %}
<mac address='{{ if.mac }}'/>