Adding Rocky systems to Foreman installation

Problem:
I have Foreman/Katello installation and need to integrate existing Rocky 8 and 9 systems into it. I am using ansible for orchestration ( no puppet ). I wonder if bootstrap.py is the right tool for this? No need to set subscription etc. I tried to run it, but it seems to need “activationkey” as required option which I don’t have. Does anybody know how resolve it? I added some fake key but there might be more elegant way of doing it.

Thanks!

Foreman and Proxy versions:
Foreman version: 3.5.3

Yes it totally works! As well as for CentOS Stream and the other RHEL clones.

You will have to create the Custom Products first, create the Activation Key and then the bootstrap script works very well. Like this (might be needed to use other parameters for your environment):

# /usr/libexec/platform-python /tmp/bootstrap.py --login <foreman-user> --server <server-fqdn> --organization <org> --location <location> --hostgroup <hostgroup> --operatingsystem 'Rocky Linux 8' --activationkey 'Rocky Linux 8' --skip puppet --install-packages=katello-host-tools-tracer --rex

(notice that the operatingsystem and activation key ‘Rocky Linux 8’ have to exist, the REX SSH key will get added to the root user in this case, I recommend to create a seperate user for that, switch the setting in the settings and use --rex-user=<username>)

1 Like

For what it’s worth, bootstrap.py is deprecated and Global Registration (Hosts > Register Host) will be the new way to register going forward. I think this should work fine as well.

1 Like

Thank you for the information. At this point I prefer bootstrap as I need to add a big number of hosts and I can run ansible role to do it automatically. I was trying to avoid Hosts → Register new host as it involved entering lots of information manually and it is hard ( if possible ) to automate process.
I was able to do the test run of bootstrap successfully. Need to fine tune my set of parameters and will put it all in the ansible role. So far one thing I noticed - program installed subscription related packages on the client which don’t really need as this is Rocky, not RHEL. Hope to find the way to avoid it, but this is not critical for sure!

The result of the register host is a shell script which you can use to register as many hosts as you like as long as the parameters stay the same.

Katello uses subscription-manager…

Great!. I will try this too. Thanks!

Just for the record - both methods worked for me. Not sure which I like more. As bootstrap is deprecated, there is no point of investing time into that.
Thank you very much for for pointing to both!

1 Like