summaryrefslogtreecommitdiff
path: root/roles/installer/debian/usb/tasks/main.yml
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-07-05 23:28:12 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-07-05 23:28:12 +0200
commit7b1e504b8b17b0e1e3caf1de3f1a3ac5cc0f3f17 (patch)
tree459313226df57aa5caa644930b53c59bf9e6c788 /roles/installer/debian/usb/tasks/main.yml
parentadd TODO for debian installer download verification (diff)
renovate usb-install
Diffstat (limited to 'roles/installer/debian/usb/tasks/main.yml')
-rw-r--r--roles/installer/debian/usb/tasks/main.yml52
1 files changed, 50 insertions, 2 deletions
diff --git a/roles/installer/debian/usb/tasks/main.yml b/roles/installer/debian/usb/tasks/main.yml
index 60c2dfd5..faf240ad 100644
--- a/roles/installer/debian/usb/tasks/main.yml
+++ b/roles/installer/debian/usb/tasks/main.yml
@@ -1,4 +1,14 @@
---
+- name: check if usb drive mountpoint exists
+ stat:
+ path: "{{ usb_install_path }}"
+ register: usb_install_mountpoint
+
+- name: fail if usb drive mountpoint does not exist
+ assert:
+ that: usb_install_mountpoint.stat.exists
+ msg: the path to the usb drive does not exist
+
- block:
- name: download installer
vars:
@@ -21,13 +31,51 @@
import_role:
name: installer/debian/preseed
- - name: Copy the preseed initramfs to the artifacts directory
+ - name: Copy the preseed initramfs to the usb drive
copy:
src: "{{ tmpdir.path }}/initrd.preseed.gz"
- dest: "{{ artifacts_dir }}/"
+ dest: "{{ usb_install_path }}/initrd.{{ install_hostname }}.gz"
always:
- name: Cleanup temporary workdir
file:
path: "{{ tmpdir.path }}"
state: absent
+
+- name: Copy linux kernel image to the USB drive
+ copy:
+ src: "{{ global_cache_dir }}/debian-installer/{{ install_distro }}-{{ install_codename }}/{{ install.arch | default('amd64') }}/linux"
+ dest: "{{ usb_install_path }}/"
+
+- name: Generate syslinux configuration for BIOS boot
+ copy:
+ dest: "{{ usb_install_path }}/syslinux.cfg"
+ content: |
+ DEFAULT {{ install_hostname }}
+ TIMEOUT 100
+ PROMPT 1
+ SAY SYSLINUX booting an automated installer for {{ install_hostname }}...
+
+ LABEL {{ install_hostname }}
+ KERNEL linux
+ INITRD initrd.{{ install_hostname }}.gz
+ APPEND install {{ (install.kernel_cmdline | default([])) | join(' ') }}
+
+- name: create EFI boot directory
+ file:
+ path: "{{ usb_install_path }}/EFI/boot"
+ state: directory
+
+- name: Generate syslinux configuration for UEFI boot
+ copy:
+ dest: "{{ usb_install_path }}/EFI/boot/syslinux.cfg"
+ content: |
+ DEFAULT {{ install_hostname }}
+ TIMEOUT 100
+ PROMPT 1
+ SAY SYSLINUX booting an automated installer for {{ install_hostname }}...
+
+ LABEL {{ install_hostname }}
+ KERNEL ../../linux
+ INITRD ../../initrd.{{ install_hostname }}.gz
+ APPEND install {{ (install.kernel_cmdline | default([])) | join(' ') }}