From f8a7983a5fa4f6f1e583838ec0de82af08bbe340 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 30 Jun 2021 20:07:53 +0200 Subject: fix some issues with ubuntu autoinstall and add preliminary ubuntu/usb installer role --- common/iso-generate.yml | 6 ++++-- common/usb-generate.yml | 9 +++++---- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'common') diff --git a/common/iso-generate.yml b/common/iso-generate.yml index 504d91ae..78047e13 100644 --- a/common/iso-generate.yml +++ b/common/iso-generate.yml @@ -3,7 +3,9 @@ hosts: "{{ install_hostnames }}" connection: local gather_facts: no + vars: + installer_variant: debian roles: - - role: installer/debian/iso - installer_base_path: "{{ global_cache_dir }}/debian-installer" + - role: "installer/{{ installer_variant }}/iso" + installer_base_path: "{{ global_cache_dir }}/{{ installer_variant }}-installer" installer_keyrings_path: "{{ global_files_dir }}/common/keyrings" diff --git a/common/usb-generate.yml b/common/usb-generate.yml index 30b0f190..7031839c 100644 --- a/common/usb-generate.yml +++ b/common/usb-generate.yml @@ -3,12 +3,13 @@ hosts: "{{ install_hostnames }}" connection: local gather_facts: no + vars: + installer_variant: debian vars_prompt: - name: usb_install_path - prompt: Where is the USB installation medium mounted to? + prompt: "Path to the the USB installation mountpoint or device" private: no - roles: - - role: installer/debian/usb - installer_base_path: "{{ global_cache_dir }}/debian-installer" + - role: "installer/{{ installer_variant }}/usb" + installer_base_path: "{{ global_cache_dir }}/{{ installer_variant }}-installer" installer_keyrings_path: "{{ global_files_dir }}/common/keyrings" -- cgit v1.2.3 From c05e1ca70925e9e68788718f05fca0f13a13bb44 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 1 Jul 2021 13:23:12 +0200 Subject: make new ubuntu-installer selectable by (usb|iso)-install.yml playbooks --- common/iso-install.yml | 21 ++++++++++++--------- common/usb-install.yml | 24 +++++++++++++----------- roles/installer/ubuntu/usb/tasks/main.yml | 2 +- 3 files changed, 26 insertions(+), 21 deletions(-) (limited to 'common') diff --git a/common/iso-install.yml b/common/iso-install.yml index ea132d4e..810761d2 100644 --- a/common/iso-install.yml +++ b/common/iso-install.yml @@ -1,26 +1,23 @@ --- -- name: preparations and sanity checks +- name: preparations, sanity checks and basic installation hosts: "{{ install_hostname }}" connection: local gather_facts: no + vars: + installer_variant: debian roles: - - role: installer/debian/iso - installer_base_path: "{{ global_cache_dir }}/debian-installer" + - role: "installer/{{ installer_variant }}/iso" + installer_base_path: "{{ global_cache_dir }}/{{ installer_variant }}-installer" installer_keyrings_path: "{{ global_files_dir }}/common/keyrings" post_tasks: - set_fact: iso_install_image_path: "{{ iso_install_target_dir }}/{{ install_hostname }}.iso" - -- name: basic installation - hosts: "{{ install_hostname }}" - gather_facts: no - tasks: - pause: prompt: | The generated image can be found at: - {{ iso_install_image_path }} + {{ iso_install_image_path | realpath }} Please load the image into the machine and boot from it. {% if install_distro == "debian" and install_cooked.efi is defined and install_cooked.efi %} @@ -33,6 +30,12 @@ {% endif %} Once the installation is done press ENTER to continue or CTRL-C then A to abort. + {% if installer_variant == 'ubuntu' %} + + Hint: You are using the ubuntu installer, this means the final system initialization and + cleanup is done by cloud-init on first boot. These steps need to be finished before the + playbook can continue. + {% endif %} - name: wait for new machine to start up, apply early roles and reboot diff --git a/common/usb-install.yml b/common/usb-install.yml index 81fe239a..a7bbe012 100644 --- a/common/usb-install.yml +++ b/common/usb-install.yml @@ -1,28 +1,30 @@ --- -- name: preparations and sanity checks +- name: preparations, sanity checks and basic installation hosts: "{{ install_hostname }}" connection: local gather_facts: no + vars: + installer_variant: debian vars_prompt: - name: usb_install_path - prompt: Where is the USB installation medium mounted to? + prompt: "Path to the the USB installation mountpoint or device" private: no - roles: - - role: installer/debian/usb - installer_base_path: "{{ global_cache_dir }}/debian-installer" + - role: "installer/{{ installer_variant }}/usb" + installer_base_path: "{{ global_cache_dir }}/{{ installer_variant }}-installer" installer_keyrings_path: "{{ global_files_dir }}/common/keyrings" - - -- name: basic installation - hosts: "{{ install_hostname }}" - gather_facts: no - tasks: + post_tasks: - pause: prompt: | Please unmount the USB the stick, plug it into the machine and boot from it. Once the installation is done press ENTER to continue or CTRL-C then A to abort. + {% if installer_variant == 'ubuntu' %} + + Hint: You are using the ubuntu installer, this means the final system initialization and + cleanup is done by cloud-init on first boot. These steps need to be finished before the + playbook can continue. + {% endif %} - name: wait for new machine to start up, apply early roles and reboot diff --git a/roles/installer/ubuntu/usb/tasks/main.yml b/roles/installer/ubuntu/usb/tasks/main.yml index c29fe2f8..c7eb9e41 100644 --- a/roles/installer/ubuntu/usb/tasks/main.yml +++ b/roles/installer/ubuntu/usb/tasks/main.yml @@ -25,7 +25,7 @@ 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 + $ sudo ddrescue {{ (ubuntu_installer_target_dir, ubuntu_installer_filename) | path_join | realpath }} {{ usb_install_path }} -D --force This will NOT be done automatically. -- cgit v1.2.3