This example will walk us through the process of adding a standalone Puppet host to Foreman for the purpose of managing the host through Puppet. In this instance we are going to create a standalone-hostgroup for the server.
Note that the Foreman server must be able listening on ports 8140, and 6163 (according to Puppet documentation). My RHEL7 Foreman host was listening on these ports, but the firewall was blocking any inbound connections. I corrected this with the commands shown below.
First I needed to determine my default firewalld zone.
# firewall-cmd –get-default-zone
Then I ran the commands below to punch a hole in the firewall to allow the required traffic. I also reloaded firewald.
# firewall-cmd –permanent –zone=public –add-port=8140/tcp
# firewall-cmd –permanent –zone=public –add-port=61613/tcp
On the puppet client, install the puppet agent
# yum -y install puppet
Now we add an entry for the puppet server in /etc/puppet/puppet.conf in section [agent], where <PUPPETSERVER-FQDN> is the FQDN of your Foreman Server
server = <PUPPETSERVER-FQDN>
Now save the file.
Then on the Puppet client run the following command.
# puppet agent -t waitforcert 60
Log into Foreman WebUI.
Navigate to => “Infrastructure” => “Smart Proxies” => “Certificates”
In the list located the new puppet client and click on sign to accept the key for the new host. The host that I am adding is osd01.lab.localdomain.
NOTE: Once you have accepted the key you need to run the puppet client again (puppet agent -t) on the client. Otherwise the client will not appear in on the “All hosts” page
Now Lets create a new Host Group to use for this server. Come on, its will be a blast.
Navigate to => “Configure” => “Host groups“. Select the green “New Host Group” button and then add your host group. Here I have added a host group called “Standalone Hosts”. See below.
Now we need to add our new client to this new host group. We do so by navigating to => “Hosts” => “All hosts“. Then select “Edit” to the left of the host.
Click “Submit” an the bottom of the page and you are good to go.