We're using Foreman strictly as an ENC – we're not using it to provision
or create hosts. Normally, in our environment anyway, when a new host
registers itself with puppet, that host appears in The Foreman. It is given
a default organization (I believe this was an added extension) and certain
defaults. This way, puppet will work with some basic classes.
For various reasons, I deleted several hosts from Foreman. Now I have new
hosts with the same hostname and, by design, the same host key in Puppet.
How do I get these hosts to show up in The Foreman?
To be clear: The Foreman does not allow me to manually create a host. Why
not? Because it wants to provision a host. This is kind of stupid, and I
dont understand why the foreman needs to act as both ENC and provisioner.
These are related, but separate roles. It would be nice if I could somehow
create a host without any kind of provisioning at all (because it already
exists, and I just need to tell TheForeman about it)
Taking each question separately:
You can just run Puppet again on your hosts, and they will be recreated
in the UI just as before. There's no difference to Foreman whether a host
has been around for 5 minutes or 5 months - when it sees a report from an
unknown host, it'll create an entry for it.
That's a valid usecase - but such hosts are usually created via the
report-in method as above. If you need to create them ahead of time, you
(a) put in fake provisioning data, Save, then Edit the host and click
Unmanage at the top right, which will remove the provisioning fields. This
button isn't available on the New Host page, unfortunately.
(b) use the CLI tool to create a host with unamanged=true in the call.
It's generally easier to use the check-in method though, as this ensures
the certname is set correctly in Foreman.
Hope that helps