Registering Windows Hosts after they are already installed?

All of the solutions I’ve found online re Windows seem to assume that Foreman is undertaking the complete PXE / unattended build for Windows. We have some existing Windows servers where we just want to be able to install the puppet agent, and then have them managed by foreman (e.g. their Puppet Classes).

But we can’t seem to find any information for how to go about doing this.

Basically we want the Windows equivalent of a manual registration.

For Linux servers (which are already built), we can do this as follows:

# rpm -Uvh http://foremanserver.massey.ac.nz/pub/katello-ca-consumer-latest.noarch.rpm
# subscription-manager register --org="MyOrganization" --activationkey="MyActivationKey"
# subscription-manager attach --auto

Following this, the Linux server will be present in Foreman and Puppet classes etc. can be set for the host.

Is there any (simple ?) way to achieve the equivalent of this but for Windows systems ?

Thanks in Advance

Patrick

Hello,

subscription-manager allows Red Hat system to consume updates and packages from Red Hat CDN or Katello/Foreman/Pulp. It is irrelevant in other Linux distros, operating systems including Windows. It creates entry in Content Host table (screens).

To create entry in Hosts table, you either enter your host manually or you can use Puppet, Ansible, Chef or Salt to register your host as “unmanaged”. Unmanaged hosts were not provisioned by Foreman but you can still use config management, remote execution or other features.

So in short, use Puppet and check in the host via “puppet agent -t” to create entry in Foreman.

1 Like

Thank you for the reply. I have tested this behaviour in my home lab using Foreman 1.17 and a recent version of Windows and it works (i.e. an entry is created).

However, at work, our production foreman instance has the Puppet Master separated out onto a different server (i.e. it is not on the same server as foreman), and it doesn’t seem to be enough to just run:

foreman agent -td

(with the puppet master specified in the puppet agent conf file)

If this is done, then I get an error about the node not known (and being unable to compile the catalog). There is also no host entry provided in Foreman.

What is the mechanism (hook ?) by which a host entry is added to Foreman if the Puppet master is on the same server ? Is there a workaround that I could use to get things working for the case where the foreman and puppet master are on different servers ?

With Thanks in Advance!

Patrick

A new host entry is automatically added when a Report or Facts for the host are submitted. In the case of the Puppet Master, this happens after the ENC script runs.

If you want to set that up in a different puppet master, I would recommend following the steps in Foreman :: Manual , or the scenario “Standalone Puppet master” in Foreman :: Manual

1 Like

Thanks guys for the hints :slight_smile: . I will practise with separating of the Puppet Master to another server with the test server in my home lab. Really appreciate the help.

Hello,
is it possible to register windows machine whitout puppet agent?
I’m understanding to Izap that yes:
"To create entry in Hosts table, you either enter your host manually or you can use Puppet, Ansible, Chef or Salt to register your host as “unmanaged”

How can I registry a Windows host only with ansible or manually with foreman ?
If I try to make with foreman manually I have to insert in Operating System tab “Partition TAble”, Operating System (no Winodws appears), root pass… Fill in Interface tabs…

If I try with puppet agent, I onlny have to install and configure the agent in the windows client? I’m not using puppet at Foreman, have I got then to use?

Thank you!