summaryrefslogtreecommitdiff
path: root/roles/vm
diff options
context:
space:
mode:
Diffstat (limited to 'roles/vm')
-rw-r--r--roles/vm/define/templates/libvirt-domain.xml.j24
-rw-r--r--roles/vm/install/tasks/main.yml4
2 files changed, 4 insertions, 4 deletions
diff --git a/roles/vm/define/templates/libvirt-domain.xml.j2 b/roles/vm/define/templates/libvirt-domain.xml.j2
index 12c4f624..5e7f8f1f 100644
--- a/roles/vm/define/templates/libvirt-domain.xml.j2
+++ b/roles/vm/define/templates/libvirt-domain.xml.j2
@@ -57,7 +57,7 @@
{% if src.type == 'lvm' %}
<source dev='/dev/mapper/{{ src.vg | replace('-', '--') }}-{{ src.lv | replace('-', '--') }}'/>
{% elif src.type == 'zfs' %}
- <source dev='/dev/zvol/{{ vm_host.zfs[src.backend | default('default')].pool }}/{{ vm_host.zfs[src.backend | default('default')].name }}/{{ install_hostname }}/{{ src.name }}'/>
+ <source dev='/dev/zvol/{{ vm_host_cooked.zfs[src.backend | default('default')].pool }}/{{ vm_host_cooked.zfs[src.backend | default('default')].name }}/{{ install_hostname }}/{{ src.name }}'/>
{% endif %}
<target dev='{{ device }}' bus='virtio'/>
</disk>
@@ -72,7 +72,7 @@
{% if src.type == 'lvm' %}
<source dev='/dev/mapper/{{ src.vg | replace('-', '--') }}-{{ src.lv | replace('-', '--') }}'/>
{% elif src.type == 'zfs' %}
- <source dev='/dev/zvol/{{ vm_host.zfs[src.backend | default('default')].pool }}/{{ vm_host.zfs[src.backend | default('default')].name }}/{{ install_hostname }}/{{ src.name }}'/>
+ <source dev='/dev/zvol/{{ vm_host_cooked.zfs[src.backend | default('default')].pool }}/{{ vm_host_cooked.zfs[src.backend | default('default')].name }}/{{ install_hostname }}/{{ src.name }}'/>
{% endif %}
<target dev='{{ device }}' bus='scsi'/>
</disk>
diff --git a/roles/vm/install/tasks/main.yml b/roles/vm/install/tasks/main.yml
index 45dd2278..13716559 100644
--- a/roles/vm/install/tasks/main.yml
+++ b/roles/vm/install/tasks/main.yml
@@ -12,7 +12,7 @@
- name: create zfs base datasets for vm
loop: "{{ hostvars[install_hostname].install_cooked.disks.virtio | default({}) | combine(hostvars[install_hostname].install_cooked.disks.scsi | default({})) | dict2items | selectattr('value.type', 'eq', 'zfs') | map(attribute='value.backend') | map('default', 'default') | unique | list }}"
zfs:
- name: "{{ vm_host.zfs[item].pool }}/{{ vm_host.zfs[item].name }}/{{ install_hostname }}"
+ name: "{{ vm_host_cooked.zfs[item].pool }}/{{ vm_host_cooked.zfs[item].name }}/{{ install_hostname }}"
state: present
extra_zfs_properties:
canmount: no
@@ -23,7 +23,7 @@
loop_control:
label: "{{ item.value.name }} on backend {{ item.value.backend | default('default') }} ({{ item.value.size }})"
zfs:
- name: "{{ vm_host.zfs[item.value.backend | default('default')].pool }}/{{ vm_host.zfs[item.value.backend | default('default')].name }}/{{ install_hostname }}/{{ item.value.name }}"
+ name: "{{ vm_host_cooked.zfs[item.value.backend | default('default')].pool }}/{{ vm_host_cooked.zfs[item.value.backend | default('default')].name }}/{{ install_hostname }}/{{ item.value.name }}"
state: present
extra_zfs_properties:
volsize: "{{ item.value.size }}"