summaryrefslogtreecommitdiff
path: root/roles/installer/debian/usb/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/installer/debian/usb/tasks/main.yml')
-rw-r--r--roles/installer/debian/usb/tasks/main.yml68
1 files changed, 42 insertions, 26 deletions
diff --git a/roles/installer/debian/usb/tasks/main.yml b/roles/installer/debian/usb/tasks/main.yml
index 44f793e9..6220b02b 100644
--- a/roles/installer/debian/usb/tasks/main.yml
+++ b/roles/installer/debian/usb/tasks/main.yml
@@ -1,10 +1,12 @@
---
- name: check if usb drive mountpoint exists
+ run_once: true
stat:
path: "{{ usb_install_path }}"
register: usb_install_mountpoint
- name: fail if usb drive mountpoint does not exist
+ run_once: true
assert:
that: usb_install_mountpoint.stat.exists
msg: the path to the usb drive does not exist
@@ -16,16 +18,19 @@
debian_installer_codename: "{{ install_codename }}"
debian_installer_arch: "{{ install.arch | default('amd64') }}"
debian_installer_variant: netboot
+ run_once: true
import_role:
role: installer/debian/fetch
- name: Create temporary workdir
tempfile:
+ prefix: "usb-install.{{ install_hostname }}."
state: directory
register: tmpdir
- name: generate pressed file
vars:
+ preseed_orig_initrd: "{{ installer_base_path }}/{{ install_distro }}-{{ install_codename }}/{{ hostvars[install_hostname].install_cooked.arch | default('amd64') }}-netboot/initrd.gz"
preseed_tmpdir: "{{ tmpdir.path }}"
import_role:
name: installer/debian/preseed
@@ -36,46 +41,57 @@
dest: "{{ usb_install_path }}/initrd.{{ install_hostname }}.gz"
always:
- - name: Cleanup temporary workdir
- when: tmpdir.path is defined
- file:
- path: "{{ tmpdir.path }}"
- state: absent
+ - name: Cleanup temporary workdir
+ when: tmpdir.path is defined
+ file:
+ path: "{{ tmpdir.path }}"
+ state: absent
- name: Copy linux kernel image to the USB drive
+ run_once: true
copy:
src: "{{ global_cache_dir }}/debian-installer/{{ install_distro }}-{{ install_codename }}/{{ install.arch | default('amd64') }}-{{ debian_installer_variant }}/linux"
dest: "{{ usb_install_path }}/"
- name: Generate syslinux configuration for BIOS boot
- copy:
+ run_once: true
+ vars:
+ syslinux_base_path: ""
+ template:
+ src: syslinux.cfg.j2
dest: "{{ usb_install_path }}/syslinux.cfg"
- content: |
- DEFAULT {{ install_hostname }}
- TIMEOUT 100
- PROMPT 1
-
- LABEL {{ install_hostname }}
- SAY SYSLINUX booting an automated installer for {{ install_hostname }}...
- KERNEL linux
- INITRD initrd.{{ install_hostname }}.gz
- APPEND install {{ (install.kernel_cmdline | default([])) | join(' ') }}
- name: create EFI boot directory
+ run_once: true
file:
path: "{{ usb_install_path }}/EFI/boot"
state: directory
- name: Generate syslinux configuration for UEFI boot
- copy:
+ run_once: true
+ vars:
+ syslinux_base_path: "../../"
+ template:
+ src: syslinux.cfg.j2
dest: "{{ usb_install_path }}/EFI/boot/syslinux.cfg"
- content: |
- DEFAULT {{ install_hostname }}
- TIMEOUT 100
- PROMPT 1
- LABEL {{ install_hostname }}
- SAY SYSLINUX booting an automated installer for {{ install_hostname }}...
- KERNEL ../../linux
- INITRD ../../initrd.{{ install_hostname }}.gz
- APPEND install {{ (install.kernel_cmdline | default([])) | join(' ') }}
+- name: Make the USB disk bootable
+ pause:
+ seconds: 0
+ prompt: |
+ You should make sure the USB disk is bootable and
+ has syslinux installed.
+
+ $ sudo apt install mbr syslinux
+ $ sudo install-mbr /dev/CHANGEME
+ $ sudo syslinux -i /dev/CHANGEME1
+ $ sudo fdisk /dev/CHANGEME
+ [Here, make sure partition 1 is marked bootable.]
+
+ for UEFI these steps need to be done
+
+ $ sudo apt install syslinux-efi
+ $ cp /usr/lib/syslinux/modules/efi64/* {{ usb_install_path }}/EFI/boot/
+ $ cp /usr/lib/SYSLINUX.EFI/efi64/syslinux.efi {{ usb_install_path }}/EFI/boot/bootx64.efi
+
+ This will NOT be done automatically.