diff options
Diffstat (limited to 'roles/vm')
-rw-r--r-- | roles/vm/define/tasks/main.yml | 1 | ||||
-rw-r--r-- | roles/vm/define/templates/libvirt-domain.xml.j2 | 9 | ||||
-rw-r--r-- | roles/vm/host/tasks/main.yml | 7 | ||||
-rw-r--r-- | roles/vm/install/meta/main.yml | 7 | ||||
-rw-r--r-- | roles/vm/install/tasks/main.yml | 25 |
5 files changed, 29 insertions, 20 deletions
diff --git a/roles/vm/define/tasks/main.yml b/roles/vm/define/tasks/main.yml index 202644dd..4c2b99e1 100644 --- a/roles/vm/define/tasks/main.yml +++ b/roles/vm/define/tasks/main.yml @@ -23,7 +23,6 @@ name: "{{ hostname }}" command: undefine - - name: define vm virt: command: define diff --git a/roles/vm/define/templates/libvirt-domain.xml.j2 b/roles/vm/define/templates/libvirt-domain.xml.j2 index c7e3a2f2..2a2e4388 100644 --- a/roles/vm/define/templates/libvirt-domain.xml.j2 +++ b/roles/vm/define/templates/libvirt-domain.xml.j2 @@ -42,13 +42,14 @@ </rng> {% if vm_define_installer and install_distro == 'openbsd' %} - <disk type='block' device='cdrom'> - <driver name='qemu' type='raw'/> - <source file='{{ installer_path }}/openbsd-{{ install_codename }}/{{ hostvars[hostname].install_cooked.arch | default('amd64') }}/install.iso'/> + <disk type='file' device='cdrom'> + <driver name='qemu'/> + <source file='{{ obsd_autoinstall_tmpdir }}/install.iso'/> <target dev='hdc' bus='ide'/> + <readonly/> </disk> -{% endif %} +{% endif %} {% if 'virtio' in hostvars[hostname].install_cooked.disks %} {% for device, src in hostvars[hostname].install_cooked.disks.virtio.items() %} <disk type='block' device='disk'> 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/meta/main.yml b/roles/vm/install/meta/main.yml deleted file mode 100644 index 710f90ad..00000000 --- a/roles/vm/install/meta/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -dependencies: - - role: installer/debian - distros: - - distro: "{{ install_distro }}" - codename: "{{ install_codename }}" - arch: [ "{{ hostvars[hostname].install_cooked.arch | default('amd64') }}" ] diff --git a/roles/vm/install/tasks/main.yml b/roles/vm/install/tasks/main.yml index 162ece24..20484401 100644 --- a/roles/vm/install/tasks/main.yml +++ b/roles/vm/install/tasks/main.yml @@ -28,16 +28,26 @@ state: directory register: tmpdir - - import_role: - name: preseed + - when: install_distro in ['debian', 'ubuntu'] vars: ssh_keys_root: "{{ hostvars[hostname].ssh_keys_root }}" preseed_tmpdir: "{{ tmpdir.path }}" preseed_force_net_ifnames_policy: path preseed_no_netplan: yes install_interface: enp1s1 + import_role: + name: installer/debian/preseed + + - when: install_distro in ['openbsd'] + vars: + ssh_keys_root: "{{ hostvars[hostname].ssh_keys_root }}" + obsd_autoinstall_tmpdir: "{{ tmpdir.path }}" + obsd_autoinstall_serial_device: com0 + install_interface: vio0 + import_role: + name: installer/openbsd/autoinstall - - name: Make preseed workdir readable by qemu + - name: Make installer workdir readable by qemu acl: path: "{{ tmpdir.path }}" state: present @@ -54,6 +64,15 @@ - debug: msg: "you can check on the status of the installer running this command 'virsh console {{ hostname }}' on host {{ inventory_hostname }}." + - when: installer_manual_steps_msg is defined + pause: + prompt: | + Mind that this installer needs manual steps to be performed: + + {{ installer_manual_steps_msg | indent(2) }} + + When done press enter to continue or Ctrl-C + 'A' to abort. + - name: wait for installer to finish or crash wait_for_virt: name: "{{ hostname }}" |