How to subscribe CentOS Server to Katello/Foreman
(: January 10, 2018)
How to subscribe centos server to katello/foreman. This tutorial will guide you through steps needed to subscribe CentOS server to consume content from Katello Server. This assumes you already have katello installed and running, you can use my Ansible Playbook Available to do quick installation.
All of these steps are performed on the host you want to register
Add epel and katello agent repos:
yum install -y http://fedorapeople.org/groups/katello/releases/yum/3.4/client/el7/x86_64/katello-client-repos-latest.rpm yum -y install http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Replace 3.4 with katello agent version you want to use.
Install subscription manager
yum -y install subscription-manager
Now download and install ca-consumer package to get a copy of the CA certificate for Katello Server.
rpm -Uvh http://katello.example.com/pub/katello-ca-consumer-latest.noarch.rpm
For above command to work, vm should be able to resolve katello.example.com hostname.
Register the client with Katello Server:
subscription-manager register --org="Angani" --activationkey="activation-key-name" subscription-manager repos --list
Activation key need to be created on foreman prior to running above command.
Installed on all client machines that are connected to Katello Server.
Katello Agent must be enabled on client servers to push the updates from the Katello Dashboard.
Also, It provides information about errata that are applicable to the system to the Katello Dashboard from there you can get to know all the details of what is required to keep the client-server up-to-date.
yum install katello-agent
Start the Katello agent service and enable it to start at the system boot.
systemctl start goferd systemctl enable goferd
Remove or move all of your repositories except redhat.repo present inside the /etc/yum.repos.d/.
cd /etc/yum.repos.d/ mkdir old mv CentOS-* epel* katello* old/
Verify whether the Katello-agent is installed on the host using the Katello Dashboard.
Hosts –> Content Hosts –>
– To install a package, go to Hosts –> Content Hosts –> Select Host –> Packages.
– Chose Package Action as “Package Remove” and then type the name of a package; then click on perform.