diff options
author | Christian Pointner <equinox@spreadspace.org> | 2021-07-01 20:32:35 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2021-07-01 20:32:35 +0200 |
commit | c2d011a50b37ad3e02e965dbb8c8960835165764 (patch) | |
tree | b27d2691903db5b52ba31adbdcc4f30975c4cb38 /roles/installer/ubuntu/iso/tasks | |
parent | ch-equinox-* install ddrecsue (diff) | |
parent | cosmetic changes (diff) |
Merge branch 'topic/new-ubuntu-installer'
Diffstat (limited to 'roles/installer/ubuntu/iso/tasks')
-rw-r--r-- | roles/installer/ubuntu/iso/tasks/main.yml | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/roles/installer/ubuntu/iso/tasks/main.yml b/roles/installer/ubuntu/iso/tasks/main.yml new file mode 100644 index 00000000..ecfc2265 --- /dev/null +++ b/roles/installer/ubuntu/iso/tasks/main.yml @@ -0,0 +1,55 @@ +--- +- 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_iso_variant }}" + import_role: + role: installer/ubuntu/fetch + +- block: + - name: create temporary workdir + tempfile: + prefix: "iso-install.{{ inventory_hostname }}." + state: directory + register: tmpdir + + - name: generate autoinstall files + vars: + ubuntu_autoinstall_tmpdir: "{{ tmpdir.path }}" + import_role: + name: installer/ubuntu/autoinstall + + - name: generate isolinux configuration for BIOS boot + template: + src: isolinux.cfg.j2 + dest: "{{ tmpdir.path }}/isolinux.cfg" + + - name: generate grub configuration for UEFI boot + template: + src: grub.cfg.j2 + dest: "{{ tmpdir.path }}/grub.cfg" + + + - name: create destination directory + file: + path: "{{ iso_install_target_dir }}" + state: directory + + - name: make sure target image does not exist + file: + path: "{{ iso_install_target_dir }}/{{ inventory_hostname }}.iso" + state: absent + + - name: generate target iso image + command: xorriso -indev "{{ ubuntu_installer_target_dir }}/{{ ubuntu_installer_filename }}" -outdev "{{ iso_install_target_dir }}/{{ inventory_hostname }}.iso" -pathspecs on -boot_image any replay -update isolinux.cfg /isolinux/isolinux.cfg -update grub.cfg /boot/grub/grub.cfg -add /autoinstall=autoinstall + args: + chdir: "{{ tmpdir.path }}" + + always: + - name: cleanup temporary workdir + when: tmpdir.path is defined + file: + path: "{{ tmpdir.path }}" + state: absent |