summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2019-12-22 14:03:06 +0100
committerChristian Pointner <equinox@spreadspace.org>2019-12-23 02:00:23 +0100
commite7b9566f9e03860bc4b84b03abff670cffd21646 (patch)
treee18f9c7f44244f55970c99d32dc14dc96362a9f5 /roles
parentsome more tests for openbsd install (diff)
openbsd: try to enable com0 for kernel terminal (WIP)
Diffstat (limited to 'roles')
-rw-r--r--roles/installer/openbsd/defaults/main.yml2
-rw-r--r--roles/installer/openbsd/tasks/main.yml43
-rw-r--r--roles/vm/define/templates/libvirt-domain.xml.j24
3 files changed, 44 insertions, 5 deletions
diff --git a/roles/installer/openbsd/defaults/main.yml b/roles/installer/openbsd/defaults/main.yml
index 004b8ecc..6650e064 100644
--- a/roles/installer/openbsd/defaults/main.yml
+++ b/roles/installer/openbsd/defaults/main.yml
@@ -5,4 +5,4 @@ openbsd_versions:
- i386
openbsd_installer_force_download: no
-openbsd_installer_url: "https://cdn.openbsd.org/pub/OpenBSD/"
+openbsd_installer_url: "https://ftp2.eu.openbsd.org/pub/OpenBSD/"
diff --git a/roles/installer/openbsd/tasks/main.yml b/roles/installer/openbsd/tasks/main.yml
index e7196258..c6317284 100644
--- a/roles/installer/openbsd/tasks/main.yml
+++ b/roles/installer/openbsd/tasks/main.yml
@@ -11,7 +11,46 @@
loop_control:
label: "openbsd-{{ item.0.version }} {{ item.1 }}"
get_url:
- url: "{{ openbsd_installer_url }}/{{ item.0.version }}/{{ item.1 }}/install{{ item.0.version | replace('.', '') }}.iso"
- dest: "{{ installer_path }}/openbsd-{{ item.0.version }}/{{ item.1 }}/install.iso"
+ url: "{{ openbsd_installer_url }}/{{ item.0.version }}/{{ item.1 }}/cd{{ item.0.version | replace('.', '') }}.iso"
+ dest: "{{ installer_path }}/openbsd-{{ item.0.version }}/{{ item.1 }}/cd.iso"
mode: 0644
force: "{{ openbsd_installer_force_download }}"
+
+- name: install xorriso
+ apt:
+ name: xorriso
+ state: present
+
+## TODO: only do this if images have been updated
+- name: extract boot.conf from original iso image
+ loop: "{{ openbsd_versions | subelements('arch') }}"
+ loop_control:
+ label: "openbsd-{{ item.0.version }} {{ item.1 }}"
+ command: xorriso -osirrox on -dev cd.iso -extract etc/boot.conf boot.conf
+ args:
+ chdir: "{{ installer_path }}/openbsd-{{ item.0.version }}/{{ item.1 }}"
+
+- name: change boot.conf to switch to com0 as main tty
+ loop: "{{ openbsd_versions | subelements('arch') }}"
+ loop_control:
+ label: "openbsd-{{ item.0.version }} {{ item.1 }}"
+ lineinfile:
+ path: "{{ installer_path }}/openbsd-{{ item.0.version }}/{{ item.1 }}/boot.conf"
+ regexp: '^set\s+tty\s'
+ line: "set tty com0"
+
+- name: make sure target image does not exist
+ loop: "{{ openbsd_versions | subelements('arch') }}"
+ loop_control:
+ label: "openbsd-{{ item.0.version }} {{ item.1 }}"
+ file:
+ path: "{{ installer_path }}/openbsd-{{ item.0.version }}/{{ item.1 }}/cd-com0.iso"
+ state: absent
+
+- name: generate target iso image
+ loop: "{{ openbsd_versions | subelements('arch') }}"
+ loop_control:
+ label: "openbsd-{{ item.0.version }} {{ item.1 }}"
+ command: xorriso -indev "cd.iso" -outdev "cd-com0.iso" -boot_image any keep -pathspecs on -add /etc/boot.conf=boot.conf
+ args:
+ chdir: "{{ installer_path }}/openbsd-{{ item.0.version }}/{{ item.1 }}"
diff --git a/roles/vm/define/templates/libvirt-domain.xml.j2 b/roles/vm/define/templates/libvirt-domain.xml.j2
index a6aea91c..809a4a1e 100644
--- a/roles/vm/define/templates/libvirt-domain.xml.j2
+++ b/roles/vm/define/templates/libvirt-domain.xml.j2
@@ -44,7 +44,7 @@
{% if vm_define_installer and install_distro == 'openbsd' %}
<disk type='file' device='cdrom'>
<driver name='qemu'/>
- <source file='{{ installer_path }}/openbsd-{{ install_codename }}/{{ hostvars[hostname].install_cooked.arch | default('amd64') }}/install.iso'/>
+ <source file='{{ installer_path }}/openbsd-{{ install_codename }}/{{ hostvars[hostname].install_cooked.arch | default('amd64') }}/cd-com0.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
@@ -52,8 +52,8 @@
<graphics type='vnc' port='5904' sharePolicy='allow-exclusive'>
<listen type='address' address='127.0.0.1'/>
</graphics>
-{% 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'>