From 2a89948bf13307cc936756c3a43bed51b3b49dc2 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 25 Dec 2019 18:20:54 +0100 Subject: openbsd vm install almost works now --- roles/vm/define/templates/libvirt-domain.xml.j2 | 6 +----- roles/vm/host/tasks/main.yml | 7 ++----- roles/vm/install/tasks/main.yml | 22 +++++++++++++++------- 3 files changed, 18 insertions(+), 17 deletions(-) (limited to 'roles/vm') diff --git a/roles/vm/define/templates/libvirt-domain.xml.j2 b/roles/vm/define/templates/libvirt-domain.xml.j2 index 809a4a1e..1abd43ed 100644 --- a/roles/vm/define/templates/libvirt-domain.xml.j2 +++ b/roles/vm/define/templates/libvirt-domain.xml.j2 @@ -44,15 +44,11 @@ {% if vm_define_installer and install_distro == 'openbsd' %} - + - - - - {% endif %} {% if 'virtio' in hostvars[hostname].install_cooked.disks %} {% for device, src in hostvars[hostname].install_cooked.disks.virtio.items() %} diff --git a/roles/vm/host/tasks/main.yml b/roles/vm/host/tasks/main.yml index ef349d4c..0e11da3d 100644 --- a/roles/vm/host/tasks/main.yml +++ b/roles/vm/host/tasks/main.yml @@ -43,10 +43,7 @@ fstype: "{{ installer_lvm.fs }}" state: mounted -- name: make sure installer directories exists - loop: - - "{{ installer_path }}" - - "{{ preseed_path }}" +- name: make sure installer directory exists file: - name: "{{ item }}" + name: "{{ installer_path }}" state: directory diff --git a/roles/vm/install/tasks/main.yml b/roles/vm/install/tasks/main.yml index 9d5ea6a2..ab94d4e5 100644 --- a/roles/vm/install/tasks/main.yml +++ b/roles/vm/install/tasks/main.yml @@ -37,13 +37,21 @@ # preseed_no_netplan: yes # install_interface: enp1s1 - # - name: Make preseed workdir readable by qemu - # acl: - # path: "{{ tmpdir.path }}" - # state: present - # entity: libvirt-qemu - # etype: user - # permissions: rx + - import_role: + name: installer/openbsd/autoinstall + vars: + ssh_keys_root: "{{ hostvars[hostname].ssh_keys_root }}" + obsd_autoinstall_tmpdir: "{{ tmpdir.path }}" + obsd_autoinstall_serial_device: com0 + install_interface: vio0 + + - name: Make installer workdir readable by qemu + acl: + path: "{{ tmpdir.path }}" + state: present + entity: libvirt-qemu + etype: user + permissions: rx - import_role: name: vm/define -- cgit v1.2.3