summaryrefslogtreecommitdiff
path: root/common/usb-install.yml
diff options
context:
space:
mode:
Diffstat (limited to 'common/usb-install.yml')
-rw-r--r--common/usb-install.yml132
1 files changed, 66 insertions, 66 deletions
diff --git a/common/usb-install.yml b/common/usb-install.yml
index b505ab01..db9faf7e 100644
--- a/common/usb-install.yml
+++ b/common/usb-install.yml
@@ -5,84 +5,84 @@
gather_facts: no
vars_prompt:
- - name: usbdrive_path
- prompt: Where is the USB installation medium mounted to?
- default: ""
- private: no
+ - name: usbdrive_path
+ prompt: Where is the USB installation medium mounted to?
+ default: ""
+ private: no
pre_tasks:
- - set_fact:
- artifacts_dir: "{{ global_artifacts_dir }}/{{ hostname }}"
- installer_path: "{{ global_cache_dir }}/debian-installer"
+ - set_fact:
+ artifacts_dir: "{{ global_artifacts_dir }}/{{ hostname }}"
+ installer_path: "{{ global_cache_dir }}/debian-installer"
- - file:
- state: directory
- name: "{{ artifacts_dir }}"
+ - file:
+ state: directory
+ name: "{{ artifacts_dir }}"
roles:
- - usb-install
+ - role: usb-install
- tasks:
- - stat:
- path: "{{ usbdrive_path }}"
- register: pathcheck
+ post_tasks:
+ - stat:
+ path: "{{ usbdrive_path }}"
+ register: pathcheck
- - when: pathcheck.stat.exists
- block:
- - name: Copy generated files to the USB drive
- loop:
- - "{{ artifacts_dir }}/initrd.preseed.gz"
- - "{{ global_cache_dir }}/debian-installer/{{ install_distro }}-{{ install_codename }}/{{ install.arch | default('amd64') }}/linux"
- loop_control:
- label: "{{ item | basename }}"
- copy:
- src: "{{ item }}"
- dest: "{{ usbdrive_path }}/"
+ - when: pathcheck.stat.exists
+ block:
+ - name: Copy generated files to the USB drive
+ loop:
+ - "{{ artifacts_dir }}/initrd.preseed.gz"
+ - "{{ global_cache_dir }}/debian-installer/{{ install_distro }}-{{ install_codename }}/{{ install.arch | default('amd64') }}/linux"
+ loop_control:
+ label: "{{ item | basename }}"
+ copy:
+ src: "{{ item }}"
+ dest: "{{ usbdrive_path }}/"
- - name: Generate syslinux configuration for BIOS boot
- copy:
- dest: "{{ usbdrive_path }}/syslinux.cfg"
- content: |
- DEFAULT linux
- SAY SYSLINUX booting an automated installer for {{ hostname }}...
- LABEL linux
- KERNEL linux
- INITRD initrd.preseed.gz
- APPEND install {{ (install.kernel_cmdline | default([])) | join(' ') }}
+ - name: Generate syslinux configuration for BIOS boot
+ copy:
+ dest: "{{ usbdrive_path }}/syslinux.cfg"
+ content: |
+ DEFAULT linux
+ SAY SYSLINUX booting an automated installer for {{ hostname }}...
+ LABEL linux
+ KERNEL linux
+ INITRD initrd.preseed.gz
+ APPEND install {{ (install.kernel_cmdline | default([])) | join(' ') }}
- - name: create EFI boot directory
- file:
- path: "{{ usbdrive_path }}/EFI/boot"
- state: directory
+ - name: create EFI boot directory
+ file:
+ path: "{{ usbdrive_path }}/EFI/boot"
+ state: directory
- - name: Generate syslinux configuration for UEFI boot
- copy:
- dest: "{{ usbdrive_path }}/EFI/boot/syslinux.cfg"
- content: |
- DEFAULT linux
- SAY SYSLINUX booting an automated installer for {{ hostname }}...
- LABEL linux
- KERNEL ../../linux
- INITRD ../../initrd.preseed.gz
- APPEND install {{ (install.kernel_cmdline | default([])) | join(' ') }}
+ - name: Generate syslinux configuration for UEFI boot
+ copy:
+ dest: "{{ usbdrive_path }}/EFI/boot/syslinux.cfg"
+ content: |
+ DEFAULT linux
+ SAY SYSLINUX booting an automated installer for {{ hostname }}...
+ LABEL linux
+ KERNEL ../../linux
+ INITRD ../../initrd.preseed.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.
+ - 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.]
+ $ 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
+ for UEFI these steps need to be done
- $ sudo apt install syslinux-efi
- $ cp /usr/lib/syslinux/modules/efi64/* {{ usbdrive_path }}/EFI/boot/
- $ cp /usr/lib/SYSLINUX.EFI/efi64/syslinux.efi {{ usbdrive_path }}/EFI/boot/bootx64.efi
+ $ sudo apt install syslinux-efi
+ $ cp /usr/lib/syslinux/modules/efi64/* {{ usbdrive_path }}/EFI/boot/
+ $ cp /usr/lib/SYSLINUX.EFI/efi64/syslinux.efi {{ usbdrive_path }}/EFI/boot/bootx64.efi
- This will NOT be done automatically.
+ This will NOT be done automatically.