summaryrefslogtreecommitdiff
path: root/roles/vm/guest/install/tasks/main.yml
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/install/tasks/main.yml
parentMerge branch 'topic/revamp-openwrt-imag-gen' (diff)
in-place variable cooking
Diffstat (limited to 'roles/vm/guest/install/tasks/main.yml')
-rw-r--r--roles/vm/guest/install/tasks/main.yml24
1 files changed, 12 insertions, 12 deletions
diff --git a/roles/vm/guest/install/tasks/main.yml b/roles/vm/guest/install/tasks/main.yml
index 06987bc3..f2bd5362 100644
--- a/roles/vm/guest/install/tasks/main.yml
+++ b/roles/vm/guest/install/tasks/main.yml
@@ -1,9 +1,9 @@
---
- name: create lvm-based disks for vm
- loop: "{{ install_cooked.disks.virtio | default({}) | combine(install_cooked.disks.scsi | default({})) | dict2items | selectattr('value.type', 'eq', 'lvm') | list }}"
+ loop: "{{ install.disks.virtio | default({}) | combine(install.disks.scsi | default({})) | dict2items | selectattr('value.type', 'eq', 'lvm') | list }}"
loop_control:
label: "{{ item.value.vg }} / {{ item.value.lv }} ({{ item.value.size }})"
- delegate_to: "{{ vm_host_cooked.name }}"
+ delegate_to: "{{ vm_host.name }}"
lvol:
vg: "{{ item.value.vg }}"
lv: "{{ item.value.lv }}"
@@ -11,31 +11,31 @@
state: present
- name: create zfs base datasets for vm
- loop: "{{ install_cooked.disks.virtio | default({}) | combine(install_cooked.disks.scsi | default({})) | dict2items | selectattr('value.type', 'eq', 'zfs') | map(attribute='value.backend') | map('default', 'default') | unique | list }}"
- delegate_to: "{{ vm_host_cooked.name }}"
+ loop: "{{ install.disks.virtio | default({}) | combine(install.disks.scsi | default({})) | dict2items | selectattr('value.type', 'eq', 'zfs') | map(attribute='value.backend') | map('default', 'default') | unique | list }}"
+ delegate_to: "{{ vm_host.name }}"
zfs:
- name: "{{ vm_host_cooked.zfs[item].pool }}/{{ vm_host_cooked.zfs[item].name }}/{{ inventory_hostname }}"
+ name: "{{ vm_host.zfs[item].pool }}/{{ vm_host.zfs[item].name }}/{{ inventory_hostname }}"
state: present
extra_zfs_properties:
canmount: no
mountpoint: none
- name: create zfs-based disk volumes for vm
- loop: "{{ install_cooked.disks.virtio | default({}) | combine(install_cooked.disks.scsi | default({})) | dict2items | selectattr('value.type', 'eq', 'zfs') | list }}"
+ loop: "{{ install.disks.virtio | default({}) | combine(install.disks.scsi | default({})) | dict2items | selectattr('value.type', 'eq', 'zfs') | list }}"
loop_control:
label: "{{ item.value.name }} on backend {{ item.value.backend | default('default') }} ({{ item.value.size }})"
- delegate_to: "{{ vm_host_cooked.name }}"
+ delegate_to: "{{ vm_host.name }}"
zfs:
- name: "{{ vm_host_cooked.zfs[item.value.backend | default('default')].pool }}/{{ vm_host_cooked.zfs[item.value.backend | default('default')].name }}/{{ inventory_hostname }}/{{ item.value.name }}"
+ name: "{{ vm_host.zfs[item.value.backend | default('default')].pool }}/{{ vm_host.zfs[item.value.backend | default('default')].name }}/{{ inventory_hostname }}/{{ item.value.name }}"
state: present
extra_zfs_properties: "{{ item.value.properties | default({}) | combine({'volsize': item.value.size}) | dehumanize_zfs_properties }}"
-- delegate_to: "{{ vm_host_cooked.name }}"
+- delegate_to: "{{ vm_host.name }}"
block:
- name: create a temporary workdir
tempfile:
- path: "{{ hostvars[vm_host_cooked.name].installer_base_path }}/"
+ path: "{{ hostvars[vm_host.name].installer_base_path }}/"
prefix: ".{{ inventory_hostname }}."
state: directory
register: tmpdir
@@ -62,7 +62,7 @@
name: vm/guest/define
- debug:
- msg: "you can check on the status of the installer running this command 'virsh console {{ inventory_hostname }}' on host {{ vm_host_cooked.name }}."
+ msg: "you can check on the status of the installer running this command 'virsh console {{ inventory_hostname }}' on host {{ vm_host.name }}."
- when: installer_manual_steps_msg is defined
pause:
@@ -90,6 +90,6 @@
- name: define vm
vars:
vm_define_installer: no
- delegate_to: "{{ vm_host_cooked.name }}"
+ delegate_to: "{{ vm_host.name }}"
import_role:
name: vm/guest/define