summaryrefslogtreecommitdiff
path: root/roles/installer/ubuntu/usb/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/installer/ubuntu/usb/tasks/main.yml')
-rw-r--r--roles/installer/ubuntu/usb/tasks/main.yml23
1 files changed, 23 insertions, 0 deletions
diff --git a/roles/installer/ubuntu/usb/tasks/main.yml b/roles/installer/ubuntu/usb/tasks/main.yml
index 26df154d..c29fe2f8 100644
--- a/roles/installer/ubuntu/usb/tasks/main.yml
+++ b/roles/installer/ubuntu/usb/tasks/main.yml
@@ -11,8 +11,27 @@
that: usb_install_device.stat.exists and usb_install_device.stat.isblk
msg: the path to the usb drive does not exist or is not a block device
+- name: download installer
+ run_once: true
+ vars:
+ ubuntu_installer_codename: "{{ install_codename }}"
+ ubuntu_installer_arch: "{{ install_cooked.arch | default('amd64') }}"
+ ubuntu_installer_variant: "{{ ubuntu_installer_usb_variant }}"
+ import_role:
+ role: installer/ubuntu/fetch
+
+- name: write ISO image to usb stick
+ pause:
+ prompt: |
+ Please write the image to the USB drive using something like this:
+
+ $ sudo ddrescue {{ ubuntu_installer_target_dir }}/{{ ubuntu_installer_filename }} {{ usb_install_path }} -D --force
+
+ This will NOT be done automatically.
+
- block:
- name: create temporary workdir
+ run_once: true
tempfile:
prefix: "usb-install.{{ inventory_hostname }}."
state: directory
@@ -25,16 +44,19 @@
name: installer/ubuntu/autoinstall
- name: generate isolinux configuration for BIOS boot
+ run_once: true
template:
src: isolinux.cfg.j2
dest: "{{ tmpdir.path }}/isolinux.cfg"
- name: generate grub configuration for UEFI boot
+ run_once: true
template:
src: grub.cfg.j2
dest: "{{ tmpdir.path }}/grub.cfg"
- name: update iso9660 filesystem on installer usb drive
+ run_once: true
become: yes
command: xorriso -dev "stdio:{{ usb_install_path }}" -pathspecs on -boot_image any replay -update isolinux.cfg /isolinux/isolinux.cfg -update grub.cfg /boot/grub/grub.cfg -find / -disk_name autoinstall -type d -exec rm_r -- -add /autoinstall=autoinstall
args:
@@ -42,6 +64,7 @@
always:
- name: cleanup temporary workdir
+ run_once: true
when: tmpdir.path is defined
file:
path: "{{ tmpdir.path }}"