Automatic registration when Provisioning Debian Hosts

Problem:
Note: I am newb to Debian - Long time EL User.

I am trying to provision Debian 12 Hosts using Katello and want to have the systems automatically register to the foreman server during build time.

In the EL hosts (rocky, centos, rhel, etc) the systems are automatically subscribed to the foreman server during build time.

I have synced the ATIX repo for subscription manager for Debian to my Katello server and want to be able to subscribe the hosts during the build.

Is there an easy way to set this up for the debian hosts where the preseed file will call the initial configuration script during the automated install?

Again - super newb to debian and preseed. Looking for some direction on how to call the initial config script during preseed.

Expected outcome:

Debian hosts are subscribed to katello at build time.

Foreman and Proxy versions:

Version 3.16.0

Foreman and Proxy plugin versions:

Distribution and version:
Oracle Linux 9

Other relevant data:

Hi,
there are some differences in the general workflow of provisioning comparing kickstart and preseed.
Preseed does not offer a nice post-install-section, this is why the preseed template includes the finish template in the end for post-install-actions. This should look like:

d-i preseed/late_command string wget --no-proxy <%= @static ? "'#{foreman_url('finish', static: 'true')}'" : foreman_url('finish') %> -O /target/tmp/finish.sh && in-target chmod +x /tmp/finish.sh && in-target /tmp/finish.sh

So this finish template is the section where you need to integrate the registration of the subscription-manager of debian-machines to Katello.

However, as the subscription-manager is not part of the OS-repositories for Debian as it is for EL (with Oracle as exception), you need to include the repository containing the subscription-manager temporarily to install it, to be able to register your system and to get the repositories from Katello afterwards.

Another issue could be that at the point of the finish-script the repositories of the installation medium are already removed and that the installation of the subscription-manager needs dependencies. So you need to find a way how to access those as well (also include installation-medium again, create an additional repo with dependencies or whichever workflow you prefer).

After the installation of the subscription-manager you can use the “subscription-manager-setup” to configure the subscription-manager and afterwards register your system with your activation keys.

1 Like

Thanks. I figured out that the finish script is where to do all of the customizations and was able to get it to register to katello using subscription manager.

1 Like