From 4575cf026fea397a5017ddb6dd2c5daf65891ab8 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 7 Jun 2020 06:24:01 +0200 Subject: fix vm install role (cook vm_host variable) --- roles/vm/define/templates/libvirt-domain.xml.j2 | 4 ++-- roles/vm/install/tasks/main.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'roles') 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' %} {% elif src.type == 'zfs' %} - + {% endif %} @@ -72,7 +72,7 @@ {% if src.type == 'lvm' %} {% elif src.type == 'zfs' %} - + {% endif %} 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 }}" -- cgit v1.2.3