Wednesday, March 11, 2015

Creating Products and Repositories within Katello

The following article will cover how to create Products and Repositories within the Katello project. There are several components that must be performed ahead of time in order to make repo management simple. Steps below are for creating custom products and does not cover Red Hat repositories. A couple definitions before we begin.

Products - Products are a collection of repositories and content within Katello. This is what you will subscribe your content hosts to in order to access these repositories.

Content Hosts - Content Hosts is a fancy way of saying clients. These are the client machines that you are registering to products (using subscription manager) and what consumes the repositories. Katello has the ability to store information about each Content Host and initiate package tasks using the katello-agent which will be covered later.

Creating a Product

1) Within your desired Organization and Location, create a new product. As mentioned, a product is a collection of repositories. so you will register your hosts to a Product and that will enable you to access repositories within that Product.
Content > Products > +New Product

2) Fill in the Name and Label and Save it.

3) Once the new product is created, create a new repository.
Click Create Repository

4) Fill out the form to create a new repository. We will create a Yum repo for this example. Using the Puppet repo since it contains a small number of packages to save disk space. Please note that you can create several different types of Repos within products but I am only demonstrating yum. Save when done.   

5) Now sync the packages to the Product. Note that you can setup a scheduled sync plan for the repos.
Click on the Repository > Sync Now


6) Create a new activation key for the newly created product so you can register content hosts without a password. 
Content > Activation Keys > +New Activation Key

7) Subscribe the New Product Product to the newly created Activation Key.
Content > Activation Keys > RecentlyCreatedKey > Subscriptions > Add > Select New Product Product from list > Add Selected

8) You can now register content hosts (clients) to the newly created product. Use the following steps to register content hosts to products. The steps are done from the content host itself.

            A) Install subscription manager on the content host if not already installed:
# wget -O /etc/yum.repos.d/subscription-manager.repo ; yum install -y subscription-manager

B) Install the Katello server CA.
# rpm -Uvh

C) Register to the Product using the activation Key.
# subscription-manager register --org="YOUR-ORG" --activationkey="activationkey" #example above key is “NewProductActivationKey”

9) You should now see the repository or repositories from the content host. Run “yum repolist” to validate. You will also see the content host populate from the Foreman web UI. You will be able to install anything from the repo using yum on the content host.

This documentation only covers the basis for creating products, repositories and registering content hosts to Products. In the next doc I will demonstrate how to  manage packages from the Web UI and how to create host collections to run bulk package actions against several hosts at a time. This is where you start to see the power of Katello and package management for your infrastructure. 

No comments:

Post a Comment