第8章 Managing Content Views

Red Hat Satellite 6 uses Content Views to create customized repositories from the repositories. To do this, you must define which repositories to use and then apply certain filters to the content. These filters include both package filters, package group filters, errata filters, and module stream filters. You can use Content Views to define which software versions a particular environment uses. For example, a Production environment might use a Content View containing older package versions, while a Development environment might use a Content View containing newer package versions.

Each Content View creates a set of repositories across each environment, which Satellite Server stores and manages. When you promote a Content View from one environment to the next environment in the application life cycle, the respective repository on Satellite Server updates and publishes the packages.

 DevelopmentTestingProduction

Content View Version and Contents

Version 2 - example_software-1.1-0.noarch.rpm

Version 1 - example_software-1.0-0.noarch.rpm

Version 1 - example_software-1.0-0.noarch.rpm

The repositories for Testing and Production contain the example_software-1.0-0.noarch.rpm package. If you promote Version 2 of the Content View from Development to Testing, the repository for Testing regenerates and then contains the example_software-1.1-0.noarch.rpm package:

 DevelopmentTestingProduction

Content View Version and Contents

Version 2 - example_software-1.1-0.noarch.rpm

Version 2 - example_software-1.1-0.noarch.rpm

Version 1 - example_software-1.0-0.noarch.rpm

This ensures systems are designated to a specific environment but receive updates when that environment uses a new version of the Content View.

The general workflow for creating Content Views for filtering and creating snapshots is as follows:

  1. Create a Content View.
  2. Add the repository and the Puppet modules that you want to the Content View.
  3. Optionally, create one or more filters to refine the content of the Content View.
  4. Optionally, resolve any package dependencies for a Content View.
  5. Publish the Content View.
  6. Optionally, promote the Content View to another environment.
  7. Attach the content host to the Content View.

If a repository is not associated with the Content View, the file /etc/yum.repos.d/redhat.repo remains empty and systems registered to it cannot receive updates.

Hosts can only be associated with a single Content View. To associate a host with multiple Content Views, create a composite Content View. For more information, see 「Creating a Composite Content View」.

Package Dependency Resolution

Package dependency is a complication of package management. For more information about how to manage package dependencies within Content Views, see 「Resolving Package Dependencies」.

8.1. Creating a Content View

Use this procedure to create a simple Content View.

Prerequisites

While you can stipulate whether you want to resolve any package dependencies on a Content View by Content View basis, you might want to change the default Satellite settings to enable or disable package resolution for all Content Views. For more information, see 「Resolving Package Dependencies」.

Procedure

To create a content view, complete the following steps:

  1. In the Satellite web UI, navigate to Content > Content Views and click Create New View.
  2. In the Name field, enter a name for the view. Satellite automatically completes the Label field from the name you enter.
  3. In the Description field, enter a description of the view.
  4. Optional: if you want to solve dependencies automatically every time you publish this Content View, select the Solve Dependencies check box. Dependency solving slows the publishing time and might ignore any Content View filters you use. This can also cause errors when resolving dependencies for errata.
  5. Click Save to create the Content View.
  6. In the Repository Selection area, select the repositories that you want to add to your Content View, then click Add Repositories.
  7. Click Publish New Version and in the Description field, enter information about the version to log changes.
  8. Click Save.
  9. Optional: to force metadata regeneration on Yum repositories, from the Actions list for your Content View versions, select Regenerate Repository Metadata.

You can view the Content View in the Content Views window. To view more information about the Content View, click the Content View name.

To register a host to your content view, see Registering Hosts in the Managing Hosts guide.

Creating a Content View with Hammer CLI

  1. Obtain a list of repository IDs:

    # hammer repository list --organization "My_Organization"
  2. Create the Content View and add repositories:

    # hammer content-view create \
    --name "Example_Content_View" \
    --description "Example Content View" \
    --repository-ids 1,2 \
    --organization "My_Organization"

    For the --repository-ids option, you can find the IDs in the output of the hammer repository list command.

  3. Publish the view:

    # hammer content-view publish \
    --name "Example_Content_View" \
    --description "Example Content View" \
    --organization "My_Organization"
  4. Optional: To add a repository to an existing Content View, enter the following command:

    # hammer content-view add-repository \
    --name "Example_Content_View" \
    --organization "My_Organization" \
    --repository-id repository_ID

Satellite Server creates the new version of the view and publishes it to the Library environment.