Autoinstalling ubuntu-server 20.04.3 from the live-iso

Ooh is it… I am using ubuntu desktop 20.04.6 version ISO.

Does that mean if I use ubuntu desktop 23.04 I can use the same templates
for provisioning & it should work?

hi , thanks for this article
im not sure regarding <hostname.short >
as i dont know the name prior to provisioning ,
and it implies that i should edit it per provisioning
(or i dindt get it right )
can you share example ?

also regarding the templates , i use Satellite 6.12 , and i can locate the mentioned preseed templates , but im not sure under what section i should associate them :
ie :
under “host initial configuration template " : ???
under " user data template” : ???
and so on for the rest of the template types

Thanks

Arik

Yeh, they switched the desktop installer to the same subiquity (server) installer in 23.04.
Best to just skip to 23.10.1 now though.

The templates should work the same for desktop autoinstall, however, I think currently they only support ‘semi-automated’ install for the desktop installer. You will have to include at least 1 interactive-section in your user-data template.
Although you can try fully automated and see what happens.

2 Likes

P.S if you really need LTS desktop install right now, you could try doing just a standard automated server installation, then just install ubuntu-desktop package on top.

There might be some other minor tweaks needed as well. See here for a decent guide: GitHub - canonical/autoinstall-desktop

2 Likes

Thanks @jamesps-ebi & @bastian-src for the help.

After using the ubuntu server 20.04.6 ISO, I was able to install the OS.
However there are still few issues:

  1. The initrd & vmlinuz are still not getting downloaded.
  2. The machine reboots after installation but still gets into PXE boot again for installation which is unlike Red Hat/Cent OS provisioning. I have to manually change the boot sequence.
  3. It seems the root password is not getting properly updated as I am not able to login via root after the installations.

Any suggestions on the above pls…

Sorry, I missed this when you said which Foreman version you are on: Foreman 3.3 cannot detect the boot files automatically since it doesn’t know the adjusted directory path. Foreman 3.4 can actually find the boot files in /casper.
So, I think you would have to upgrade Foreman to solve this issue.

This sounds like your finish template is not executed successfully. Do you see in your Foreman log that the client downloads the template? Or in your Ubuntu installation log, can you see that something similar to “curtin wget <template URL>” (you can see the actual URL when you look at the rendered userdata template) is executed?

“2.” and “3.” could occur due to issues in the userdata template. At the time of the 3.3 release, Ubuntu Autoinstall has been in an early stage for us.
I think in Foreman 3.3, there has been an issue with the finish template not being downloaded and you couldn’t create a root user. Both was fixed with this commit:

The commit is part of Foreman 3.4.

Even though you might be able to fix 2. & 3. by using the latest version of the template, I’d recommend you upgrading your Foreman in order to get the latest changes & fixes.

I hope this helps :crossed_fingers:

1 Like

Hey together I’ve been reading through this and a lot of other posts the past days. I’m trying to implement Foreman at my company and installed Foreman with a running Discovery Image for UEFI and Legacy clients so far. My Testclients can boot into the Discovery Image and get recognised by Foreman. Im stuck at the part of starting the provisioning of discovered Hosts atm. I’m a beginner with Foreman and I’m overwhelmed by all the different posts.

My goal is to get Ubuntu 20.04 and Ubuntu 22.04 Provisioning to work after Hosts have been discovered.

  • Foreman 3.7.0 is installed on Ubuntu 20.04
  • Active Features:
    Discovery
    HTTPBoot
    Logs
    Puppet
    Puppet CA
    TFTP

Following this thread I’m not sure which steps are still needed and which are not. Is there a cleaner description for the needed steps 2024? It seems for me as some steps the creator of this Thread did are not needed anymore as they have been implemented in Default Templates by Foreman Devs themselves?

Which Templates are needed minimum to get provisioning with autoinstall to work? Do I need Linux host_init_config default or Preseed Default? Pretty sure I saw both versions in different posts till now.

Do I have to use iPXE or can I just use PXE?

Also can I follow the instructions inside the manual for RH with adjusted paths? Provisioning Hosts

I can’t find up to date instructions for Debian regarding this case inside the Manual, correct me if I’m wrong…

If my provided Info isn’t enough let me know, I would gladly share more to get some guidance!

Kind Regards
Gabriel

I also struggled with which templates were needed, but ended up using Preseed default finish, Preseed default PXEGrub2 Autoinstall, and Preseed Autoinstall cloud-init user data.

1 Like

@lzap I am having issues with getting Ubuntu 22.04 provisioned throught Foreman and I have described my issue with the user-data file in post Need help with PXE booting Ubuntu 22.04 on Foreman v 3.5 (nginx), getting 404 Not Found on userdata.

I am using dhcp for the host IP so I do not know the host IP in advance when I provision the host, I am getting 404 on the user-data when I try to provision a host with the following PXELinux line for userdata: ds=nocloud;s=http://<%= foreman_request_addr %>/userdata/.

I can get the provisioning working if I do specify the IP address in the interface menu on Foreman, but cannot get it working with just the MAC address - I am confused if Foreman still does not have the feature to source user-data file with just the MAC address?

I can although get it working if I use - ds=nocloud;s=http://<%= foreman_request_addr %>/userdata/<%= @host.mac %>/ - Is it ok to use the @host.mac in the APPEND line in this case???

Any help is appreciated, Thank you!

Preseed and user-data both use REMOTE_IP to detect the host which is calling home. It is designed this way, therefore, you must allocate the IP in advance. I do not think there is any workaround as far as I am aware.

For some workflows, REMOTE_IP might be just a fallback mechanism, I am not sure if tokens are used for any of these.

Thanks everyone for the support, I was able to successfully provision the Ubuntu OS.

As I stumbled over some minutes ago, can someone confirm that the following changes are required with 22.04.3 in the template “Preseed Autoinstall cloud-init user data”.

  • changing hashed_password to password
  • removing the else with the empty array for ssh_authorized_keys

Until I changed this I got some schema errors and with the changes 22.04.2 and 22.04.3 work fine for me. But I want someone to confirm this as I want to be 100% sure before make a PR to change the template.

Hey Dirk,

sorry for the late response. But yes, you’re absolutely right about that. The issues have been reported by a user in this issue:

and were fixed by this PR:

Still, there is currently an issue with the netplan which affects the Autointall template too. We’re working on it as part of this PR:

1 Like