Satellite 6 - Adding an existing host with full management

Latest response

Following up from the discussion in the Satellite video thread:
https://access.redhat.com/discussions/1517523

I have a requirement to add RHEL hosts built outside of Satellite to the Satellite 6 server. Doing this for subscription manager services (eg. yum) is fairly straightforward and the host will be displayed under 'Content Hosts', but to get an existing server (that isn't provisioned through Satellite) to appear in 'All Hosts' to allow management with Puppet appears a little more involved.

As suggested in the linked thread above, I have investigated using the hammer-cli and API to carry out the add automatically but it appears there are still some gaps in the process, so would appreciate any input on your experiences/solutions.

The goal of this process:
1. Build host outside of Satellite
2. Register with Satellite for updates / package management
3. Register with Satellite to assign Puppet classes / remediate configuration

This is currently achieved with another product, but am looking to combine multiple products into Satellite 6. The steps listed here can be run from the freshly built host (and packages etc. cleaned up afterwards) or from an orchestration host.

Process:
1. Build standard RHEL X.x build

2. Install katello-ca package rpm from Satellite 6 server

rpm -ivh http://sat61b.network.local/pub/katello-ca-consumer-latest.noarch.rpm

3. Use subscription-manager to subscribe the system to Satellite 6 for packages / updates

subscription-manager register --username=admin --password=password --org=Default_Organization --auto-attach

At this stage the host will appear under Host -> Content Hosts on the Satellite 6 server.

4. Subscribe the host to the Satellite tools repo for installation of additional components

subscription-manager repos --enable=rhel-7-server-satellite-tools-6-beta-rpms

5. Install additional tools that are used for host creation/registration on Satellite 6 server

yum install -y facter katello-agent puppet rubygem-hammer_cli rubygem-hammer_cli_katello

6. Use the hammer CLI to create the empty host record on the Satellite 6 server (facter used to pull MAC). Note: to determine the numbers to pass in you need to call hammer against each item to determine the ID number it has been allocated eg. hammer environment list. This is a long command, scroll right to see the whole thing!

hammer  --server https://sat61b.network.local --username admin --password password host create --name "$(facter hostname) --environment-id 1 --architecture-id 1 --domain-id 1  --puppet-proxy-id 1 --operatingsystem-id 1 --partition-table-id 7 --location-id 2 --organization-id 1 --medium-id 7 --root-password "password" --mac "$(facter macaddress)" --build 0

At this stage you will now have a host record under 'All Hosts' matching the hostname of your new host.

7. Next, create a Puppet certificate signing request. You will need to modify the Puppet configuration file before running the following command, or alternatively pass the Satellite 6 hostname at the command line for the initial request.

puppet agent -t --server sat61b.network.local

The Puppet signing request will now be listed under Infrastructure -> Capsules -> Capsule Name -> Certificates

This is where the automated process falls down. I haven't been able to find a way for Hammer CLI or the API to sign the certificates remotely. Additionally, there doesn't appear to be a method to create Autosign entries using the CLI/API (this could be done after step 6). I have found an associated bug report here:
https://bugzilla.redhat.com/show_bug.cgi?id=1140671

Is anyone able to provide/suggest workaround? or a different method to do the scripted registration of existing hosts? Does anyone have a single line answer that makes all of the above look irrelevant?

Responses