Table des matières

The Foreman installation with Katello support

Katello is a content manager which allows to create, organize and manage Yum and Puppet repositories. Sync remote repositories or upload content directly to build your own custom content. Katello is now fully integrated to The Foreman, the provisioning and configuration solution. Katello permits to keep in sync many external sources :

More readings :

Prerequisites

Software

Foreman/Katello install on amd64 arch excusively, and can run on RHEL/CentOS 6 or 7.

Hardware

12GB are highly recommended.

minimum recommended
RAM 8GB 12GB
CPU 2 cores 4 cores

Storage

Red Hat strongly recommends to use LVM for partitioning, and XFS as filesystem for storage and database.

mountpoint size comments
/ 10GB base system
/var/lib/pulp 500GB+ storage for mirrored repositories
/var/lib/mongodb 20GB-100GB storage database
/var/lib/pgsql 2GB-50GB storage database

Installation

storage & filesystem

lvcreate -n pulp -L 500G vg_foreman
lvcreate -n mongodb -L 50G vg_foreman
lvcreate -n pgsql -L 50G vg_foreman
 
mkfs.xfs /dev/vg_foreman/pulp
mkfs.xfs /dev/vg_foreman/mongo
mkfs.xfs /dev/vg_foreman/pgsql
mkdir /var/lib/mongodb /var/lib/pulp /var/lib/pgsql
 
cat <<EOF >> /etc/fstab
/dev/vg_foreman/pulp   /var/lib/pulp     xfs  defaults 0 0
/dev/vg_foreman/mongo  /var/lib/mongodb  xfs  defaults 0 0
/dev/vg_foreman/pgsql  /var/lib/pgsql    xfs  defaults 0 0
EOF
 
mount -a

Software dependencies

yum install -y epel-release
yum update -y
# Katello
yum -y localinstall http://fedorapeople.org/groups/katello/releases/yum/3.4/katello/el7/x86_64/katello-repos-latest.rpm
# The Foreman
yum -y localinstall http://yum.theforeman.org/releases/1.15/el7/x86_64/foreman-release.rpm
# Puppet 4
yum -y localinstall https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm

Software installaton

yum -y install foreman-release-scl
yum update -y
yum install -y katello
foreman-installer --scenario katello
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --permanent --zone=public --add-service=tftp
firewall-cmd --permanent --zone=public --add-service=puppetmaster
firewall-cmd --permanent --zone=public --add-port=8080/tcp
firewall-cmd --reload

Configuration

Mirror a Yum repository

In the below example, we'll mirror CentOS 7 base repository.

Organization

On a fresh Foreman install, the very first step is to create an organization

<columns - → On the Menu bar, click on Any Context, then on Manage Organizations menu item <newcolumn> </columns>


<columns - → Click on New Organization Button <newcolumn> </columns>


<columns - → Fill the fields accordingly to your need :

<newcolumn> </columns>


Sync plan

<columns - → On the Menu bar, click on Content, then on Sync Plans menu item <newcolumn> </columns>


<columns - → Click on Create Sync Plan Button <newcolumn> </columns>


<columns - → Fill the form with the following informations :

Then click on Save button. <newcolumn> </columns>


GPG key

We need to import the GPG key used by the remote repository. In our case, the GPG key is accessible on http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7

<columns - → On the Menu bar, click on Content, then on GPG Keys menu item <newcolumn> </columns>


<columns - → Click on Create GPG Key Button <newcolumn> </columns>


<columns - → Fill the form with the following informations :

Then click on Save button. <newcolumn> </columns>


Product

<columns - → On the Menu bar, click on Content, then on Products menu item <newcolumn> </columns>


<columns - → Click on Create Product Button <newcolumn> </columns>


<columns - → Fill the form with the following informations :

Then click on Save button. <newcolumn> </columns>


<columns - → One the product is created, the user is automatically directed to the Repositories pane. At this time there is not yet any configured repository, so let's create one by clicking on the New Repository button : <newcolumn> </columns>


<columns - - → Fill the form with the following informations :

Then click on Save button. <newcolumn> <newcolumn> </columns>


Lifecycle Environments

<columns - → On the Menu bar, click on Content, then on LifeCycle Environments menu item <newcolumn> </columns>


<columns - → Click on Create Environment Path Button <newcolumn> </columns>


<columns - → Fill the form with the following informations :

Then click on Save button. <newcolumn> </columns>


Content View

<columns - → On the Menu bar, click on Content, then on Content Views menu item <newcolumn> </columns>


<columns - → Click on Create New View Button <newcolumn> </columns>


<columns - → Fill the form with the following informations :

Then click on Save button. <newcolumn> </columns>


<columns - → Once the view is created, go on the Yum Content pane, then select the Add pane from the Repository Selection

Then select the repositories to include into the view (in the example below, base and updates repositories from CentOS 7 Product are selected.

Finally, click on Add Repositories button. <newcolumn> </columns>


<columns - → go on the Versions pane, then click on Publish New Version button. <newcolumn> </columns>


<columns - → Fill the Description form, then click on Save button. <newcolumn> </columns>


<columns - → The version is going to be published. This may take a while.

When the publshing procedure is completed, you can click on the Promote button for the Version 1.0. <newcolumn> </columns>


<columns - → Select the right library by clicking on the checkbox, then click on Promote Version. <newcolumn> </columns>


Activation keys

<columns - → On the Menu bar, click on Content, then on Activation Keys menu item <newcolumn> </columns>


<columns - → Click on Create Activation Key Button <newcolumn> </columns>


<columns - → Fill the form with the following informations :

Then click on Save button. <newcolumn> </columns>


<columns - → Once the key is created, it can be used to register client hosts to this system by using the following command :

subscription-manager register --org="orga_axians_aix" --activationkey="Axians Aix production key"

<newcolumn> </columns>


Configure client host

Prerequisites

The target system must have the required package installed prior registration :

In the following example, the Foreman/Katello server IP address is 192.168.122.178 and its FQDN is katello.internal.lan :

yum install -y subscription-manager
yum localinstall -y http://192.168.122.178/pub/katello-ca-consumer-katello.internal.lan-1.0-1.noarch.rpm

Client registration

In order to register a client host to Katello, you need to provide the following elements :

subscription-manager register --org="orga_axians_aix" --activationkey="Axians Aix production key"
The system has been registered with ID: c21106ec-9991-4246-b101-966b2dda99a8 
 
No products installed.

List available subscriptions

  subscription-manager list --available --all
  +-------------------------------------------+
      Available Subscriptions
  +-------------------------------------------+
  Subscription Name:   EPEL7 for CentOS/RHEL
  Provides:            
  SKU:                 884388902125
  Contract:            
  Pool ID:             4028fa325e577a77015e5b0d989a0025
  Provides Management: No
  Available:           Unlimited
  Suggested:           1
  Service Level:       
  Service Type:        
  Subscription Type:   Standard
  Ends:                08/31/2047
  System Type:         Physical

Attach to a subscription

  subscription-manager attach --pool=4028fa325e577a77015e5b0d989a0025
  Successfully attached a subscription for: EPEL7 for CentOS/RHEL