In my “old” environment, I have a TFTP server that offers a menu of available OS’s. To provision a linux host, they just pick from a menu. Each entry in pxe includes flags about what was picked (server vs workstation, which disk to install on, etc). It installs and runs puppet. The admins don’t have to setup the host ahead of time.
I’m hoping there’s a way of doing something similar in Foreman. I want the onboard process to be as easy as possible. Give them a list of options. Then the machine installs and gets setup in foreman using defaults (ideally based on what they picked).
The best way to achieve that is to define a “combination” for a provisioning template in it’s edit form, see the association tab. Then you must deploy the default pxe template to your TFTP server. On provisioning templates tab, hit the Build PXE default button. It will generate entry for each hostgroup for which tou created the combination. The hostgroup must define all attributes required for provisioning. You can create hostgroups matching the OSes you want to allow for provisioning through the PXE menu.
I’m trying to parse this Marek. I would create a new pxe template that just has the boot options I want (so I manually have to set CentOS 8 Steam or whatever). Then use the Association tab to assign an OS and associate it with a hostgroup?
I’m not quite understanding what that does? Can it use that OS association to build the menu using some variables in the template?
What is the combination used for? As far as I can tell, that restricts which hosts can use that template, right? So I’d still have to create the host in Foreman before being able to install it?
Foreman has a lot of concepts that are new to me. I think they’re very powerful, but it’s takes a bit to wrap my mind around things.
it is a bit hidden feature and we have no documentation for it, because it does not work well with our kickstart templates which we ship with Foreman. They all assume there is a @host in the context, while in this “hostgroup provisioning” there is not.
Here is a lengthy video that hopefully describes it. It is a bit out of date, however, still applies. Grab a coffee!
That looks like exactly what I want. Thank you for linking to the video. I wasn’t understanding that it needed a custom kickstart template to work.
A couple of questions:
1 - Is the ’ all media’ workaround still needed?
2 - I assume we can include snippets in the custom kickstart file as long as @host isn’t used? He also mentions some other variables that won’t work. Is there a list?
3 - At the end he mentions that once you run puppet it will show up in Foreman as an unmanaged host. Is there any way to address that? I don’t think that will be a big deal for us, just curious.
Another question. Since it doesn’t register the host in Foreman, the host is not in the hostgroup when puppet runs. Therefore it won’t get any parameters from that host group. So I would be losing most of the features of the Puppet ENC. I’d have to do all of the node stuff in puppet directly. Is there any way to work around that? I could go assign it to a hostgroup after the fact, but that kind of defeats the purpose of what I’m hoping to accomplish.
I vaguely remember I do not think you need this. That was some Katello compatibility issue I think.
Exactly, feel free to update Foreman default templates or snippets to work without @host if you want to.
If you install puppet agent (or any other client that creates hosts in foreman via facts) an unmanaged host will be created for you unless you disable that in settings
I am not sure how to solve that honestly, perhaps get a host registered? We now have couple of registration snippets which you could use too (the new host registration feature). If you do that before puppet it should work? I am not sure how to associate hostgroup tho, I think there is some kind of plugin for that too.