第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, and errata 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.

コンテンツビューは各環境でリポジトリーセットを作成し、Satellite Server が保存して管理します。アプリケーションライフサイクルの次の環境にコンテンツビューをプロモートすると、それに対応する Satellite Server のリポジトリーがパッケージを更新して公開します。

 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.

スナップショットのフィルタリングと作成に使用するコンテンツビューを作成する一般的なワークフローは、以下の通りです。

  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. Publish the Content View.
  5. Optionally, promote the Content View to another environment.
  6. 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.

ホストを関連付けるコンテンツビューは 1 つだけにすることができます。複数のコンテンツビューにホストを関連付けるには、複合コンテンツビューを作成します。詳細は「Creating a Composite Content View」を参照してください。

8.1. Creating a Content View

Use this procedure to create a simple Content View.

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. 名前 フィールドで、ビューの名前を入力します。Red Hat Satellite 6 では、入力した名前から、ラベル フィールドに自動的に入力されます。
  3. 説明 フィールドに、ビューの説明を入力します。
  4. Click Save to create the Content View.
  5. In the Repository Selection area, select the repositories that you want to add to your Content View, then click Add Repositories.
  6. 新規バージョンの公開 をクリックし、説明 フィールドに、変更をログに記録するバージョンについての情報を入力します。
  7. 保存をクリックします。
  8. オプション: Yum リポジトリーでメタデータを再生成させるには、コンテンツビューバージョンの アクション リストから、リポジトリーメタデータの再生成 を選択します。

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

コンテンツビューにホストを登録するには、『ホストの管理』ガイドの「ホストの登録」を参照してください。

For CLI Users

  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"

    --repository-ids オプションを使用すると、hammer repository list コマンドの出力で ID が分かります。

  3. Publish the view:

    # hammer content-view publish \
    --name "Example_Content_View" \
    --description "Example Content View" \
    --organization "My_Organization"

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

8.2. Viewing Module Streams

In Satellite, you can view the module streams of the repositories in your Content Views.

Procedure

To view module streams for the repositories in your content view, complete the following steps:

  1. In the Satellite web UI, navigate to Content > Content Views, and select the Content View that contains the modules you want to view.
  2. バージョン タブをクリックし、表示するコンテンツビューバージョンを選択します。
  3. モジュールストリーム タブをクリックして、コンテンツビューに利用できるモジュールストリームを表示します。
  4. フィルター フィールドを使用して、モジュールのリストを絞り込みます。
  5. To view the information about the module, click the module.

8.3. Creating a Content View with a Puppet Module

以下の手順を使用して、フィルターなしで、リポジトリーを 1 つ使用するコンテンツビューを作成します。

Procedure

To create a Content View with a Puppet module, complete the following steps:

  1. In the Satellite web UI, navigate to Content > Content Views and click Create New View.
  2. 名前 フィールドで、ビューの名前を入力します。Red Hat Satellite 6 では、入力した名前から、ラベル フィールドに自動的に入力されます。
  3. 説明 フィールドに、ビューの説明を入力します。
  4. Click Save to complete.
  5. In the Repository Selection area, select the repositories that you want to add to your Content View, then click Add Repositories.
  6. Puppet モジュール タブで 新規モジュールの追加 をクリックします。
  7. 追加するモジュールを探し、バージョンの選択 をクリックします。
  8. Navigate to the entry for Use Latest and click Select Version in the Actions column.
  9. 公開するには、バージョン タブをクリックし、新規バージョンの公開 をクリックします。説明 フィールドに、変更をログに記録する説明を入力し、保存 をクリックします。

コンテンツビューにホストを登録するには、『ホストの管理』ガイドの「ホストの登録」を参照してください。

8.4. Promoting a Content View

以下の手順を使用して、異なるライフサイクル環境全体に、コンテンツビューをプロモートします。

Permission Requirements for Content View Promotion

Non-administrator users require two permissions to promote a Content View to an environment:

  1. promote_or_remove_content_views
  2. promote_or_remove_content_views_to_environment.

promote_or_remove_content_views パーミッションで、ユーザーがプロモートできるコンテンツビューを制限します。

promote_or_remove_content_views_to_environment パーミッションで、コンテンツビューのプロモート先となる環境を制限します。

上記のパーミッションを使用すると、指定の環境に指定のコンテンツビューをプロモートし、それ以外の環境にはプロモートできないように、ユーザーパーミッションを割り当てることができます。たとえば、テスト環境へのプロモーションはできるが、実稼働環境にはできないようにユーザーを制限できます。

コンテンツビューをプロモートできるようにするには、ユーザーに両パーミッションを割り当てる必要があります。

Procedure

To promote a Content View, complete the following steps:

  1. In the Satellite web UI, navigate to Content > Content Views and select the Content View that you want to promote.
  2. コンテンツビューの バージョン タブをクリックします。
  3. プロモートするバージョンを選択し、アクション 列で、プロモート をクリックします。
  4. コンテンツビューをプロモートする環境を選択し、バージョンのプロモート をクリックします。
  5. プロモート ボタンを再度クリックします。今度は テスト 環境を選択して バージョンのプロモート をクリックします。
  6. Finally click on the Promote button again. Select the Production environment and click Promote Version.

Now the repository for the Content View appears in all environments.

For CLI Users

  • Promote the Content View using the hammer content-view version promote each time:

    # hammer content-view version promote \
    --content-view "Database" \
    --version 1 \
    --to-lifecycle-environment "Development" \
    --organization "My_Organization"
    # hammer content-view version promote \
    --content-view "Database" \
    --version 1 \
    --to-lifecycle-environment "Testing" \
    --organization "My_Organization"
    # hammer content-view version promote \
    --content-view "Database" \
    --version 1 \
    --to-lifecycle-environment "Production" \
    --organization "My_Organization"

    Now the database content is available in all environments.

コンテンツビューにホストを登録するには、『ホストの管理』ガイドの「ホストの登録」を参照してください。

8.5. Composite Content Views Overview

A Composite Content View combines the content from several Content Views. For example, you might have separate Content Views to manage an operating system and an application individually. You can use a Composite Content View to merge the contents of both Content Views into a new repository. The repositories for the original Content Views still exist but a new repository also exists for the combined content.

さまざまなデータベースサーバーをサポートするアプリケーションを開発する場合には、example_application は次のように表示されます。

example_software

Application

Database

Operating System

Example of four separate Content Views:

  • Red Hat Enterprise Linux (Operating System)
  • PostgreSQL (Database)
  • MariaDB (Database)
  • example_software (Application)

From the previous Content Views, you can create two Composite Content Views.

Example Composite Content View for a PostgreSQL database:

複合コンテンツビュー 1: PostgreSQL の example_software

example_software (Application)

PostgreSQL (Database)

Red Hat Enterprise Linux (Operating System)

Example Composite Content View for a MariaDB:

Composite Content View 2 - example_software on MariaDB

example_software (Application)

MariaDB (Database)

Red Hat Enterprise Linux (Operating System)

これで各コンテンツビューは別個に管理して公開されます。アプリケーションのバージョンを作成すると、複合コンテンツビューの新バージョンを公開することになります。複合コンテンツビューの作成時に、自動公開 オプションを選択することも可能です。自動公開オプションを選択して、複合コンテンツビューに含まれるコンテンツビューが再公開されると、自動的に複合コンテンツビューが再公開されます。

Repository Restrictions

複合コンテンツビューは、各リポジトリーで 1 つしか許可されません。たとえば、同じリポジトリーを使用したコンテンツビューを 2 つ追加しようとすると、Satellite Server はエラーをレポートします。

8.6. Creating a Composite Content View

Procedure

To create a Composite Content View, complete the following steps:

  1. In the Satellite web UI, navigate to Content > Content Views and click Create New View.
  2. 名前 フィールドで、ビューの名前を入力します。Red Hat Satellite 6 では、入力した名前から、ラベル フィールドに自動的に入力されます。
  3. 説明 フィールドに、ビューの説明を入力します。
  4. Select the Composite View? check box to create a Composite Content View.
  5. オプション: コンテンツビューが再公開されると複合コンテンツビューが自動的に再公開されるようにするには、自動公開 チェックボックスを選択します。
  6. 保存をクリックします。
  7. コンテンツビューの追加 エリアで、複合コンテンツビューに追加するコンテンツビューを選択して、Add Content Views をクリックします
  8. Publish New Version をクリックして、複合コンテンツビューを公開します。説明 フィールドに説明を入力し、保存 をクリックします。
  9. プロモート をクリックし、複合コンテンツビューをプロモートするライフサイクル環境を選択し、説明を入力して、バージョンのプロモート をクリックします。

For CLI Users

  1. Before you create the Composite Content Views, list the version IDs for our existing Content Views:

    # hammer content-view version list \
    --organization "My_Organization"
  2. 新しい複合コンテンツビューを作成し、--component-ids オプションを使用して、コンテンツビューバージョン ID のコンマ区切りのリストを追加します。--auto-publish オプションを yes に設定すると、複合コンテンツビューに含まれるコンテンツビューが再公開されると、自動的に複合コンテンツビューが再公開されます。

    # hammer content-view create \
    --composite \
    --auto-publish yes \
    --name "Example_Composite_Content_View" \
    --description "Example Composite Content View" \
    --component-ids Content_View_Version_IDs \
    --organization "My_Organization"
  3. Publish the Composite Content View:

    # hammer content-view publish \
    --name "Example_Composite_Content_View" \
    --description "Initial version of Composite Content View" \
    --organization "My_Organization"
  4. Promote the Composite Content View across all environments:

    # hammer content-view version promote \
    --content-view "Example_Composite_Content_View" \
    --version 1 \
    --to-lifecycle-environment "Development" \
    --organization "My_Organization"
    # hammer content-view version promote \
    --content-view "Example_Composite_Content_View" \
    --version 1 \
    --to-lifecycle-environment "Testing" \
    --organization "My_Organization"
    # hammer content-view version promote \
    --content-view "Example_Composite_Content_View" \
    --version 1 \
    --to-lifecycle-environment "Production" \
    --organization "My_Organization"

8.7. Content Filter Overview

コンテンツビューでは、フィルターを使って特定の RPM コンテンツを追加したり制限したりします。フィルターを使用しないと、選択したリポジトリーからのすべてのコンテンツが含まれてしまいます。

There are two types of content filters:

表8.1 Filter Types

Filter TypeDescription

Include

コンテンツなしの状態から開始し、選択したリポジトリーから追加するコンテンツを選択します。このフィルターを使用して、複数のコンテンツアイテムを組み合わせます。

Exclude

You start with all content from selected repositories, then select which content to remove. Use this filter when you want to use most of a particular content repository but exclude certain packages, such as blacklisted packages. The filter uses all content in the repository except for the content you select.

包含と除外のフィルターの組み合わせ

包含と除外のフィルターの組み合わせを使用してコンテンツビューを公開すると、最初に包含フィルターが適用され、次に除外フィルターが適用されます。この場合には、先に、含めるコンテンツを選択してから、このサブセットから除外するコンテンツを選択することになります。

Content Types

There are also four types of content to filter:

表8.2 Content Types

Content TypeDescription

Package

Filter packages based on their name and version number.

Package Group

パッケージグループ別に、パッケージをフィルタリングします。パッケージグループの一覧は、コンテンツビューに追加されたリポジトリー別になっています。

Erratum (by ID)

フィルターに追加する特定のエラータを選択します。エラータ一覧は、コンテンツビューに追加されたリポジトリー別になっています。

Erratum (by Date and Type)

Select a issued or updated date range and errata type (Bugfix, Enhancement, or Security) to add to the filter.

パッケージの依存関係の解決とフィルター

Filters do not resolve any dependencies of the packages listed in the filters. Ensure to add package dependencies to the filter. This might require some level of testing to determine what dependencies are required.

8.8. Content Filter Examples

Use any of the following examples with the procedure that follows to build custom content filters.

Example 1

Create a repository with the base Red Hat Enterprise Linux packages. This filter requires a Red Hat Enterprise Linux repository added to the Content View.

Filter:

  • Inclusion Type: Include
  • Content Type: Package Group
  • Filter: Select only the Base package group

Example 2

セキュリティーアップデートを除く、特定日以降の全エラータを除外するリポジトリーを作成します。これは、重要なセキュリティーアップデートは即座に適用する必要があるが、その他のシステムアップデートは定期的に実行する場合に便利です。このフィルターでは、Red Hat Enterprise Linux リポジトリーをコンテンツビューに追加しておく必要があります。

Filter:

  • Inclusion Type: Exclude
  • Content Type: Erratum (by Date and Type)
  • フィルター: バグ修正機能強化のエラータタイプのみを選択し、セキュリティーの選択は解除します。日付タイプ更新日に設定します。エラータを制限する日付を開始日に設定します。終了日は空白にして、セキュリティー以外の新たなエラータにフィルターが適用されないようにします。

Example 3

例 1 と例 2 の組み合わせで、オペレーティングシステムパッケージのみが必要で、最近のバグ修正と機能強化エラータを除外します。この場合には、同一のコンテンツビューにアタッチされた 2 つのフィルターが必要です。コンテンツビューは組み込みフィルターを最初に適用してから、除外フィルターを適用します。

Filter 1:

  • Inclusion Type: Include
  • Content Type: Package Group
  • Filter: Select only the Base package group

Filter 2:

  • Inclusion Type: Exclude
  • Content Type: Erratum (by Date and Type)
  • フィルター: バグ修正機能強化のエラータタイプのみを選択し、セキュリティーの選択は解除します。日付タイプ更新日に設定します。エラータを制限する日付を開始日に設定します。終了日は空白にして、セキュリティー以外の新たなエラータにフィルターが適用されないようにします。

コンテンツフィルターの機能例については、How do content filters work in Satellite 6 を参照してください。

8.9. Creating a Content Filter

以下の手順を使用して、コンテンツフィルターを作成します。フィルターをビルドする方法の例については、「Content Filter Examples」を参照してください。

Procedure

To create a content filter, complete the following steps:

  1. In the Satellite web UI, navigate to Content > Content Views and select a Content View.
  2. Yum コンテンツ > フィルターに移動し、新規フィルターをクリックします。
  3. 名前 フィールドに、フィルターの名前を入力します。
  4. コンテンツタイプ の一覧から、絞り込むコンテンツタイプを選択します。新しいフィルターのコンテンツタイプに選択した内容に応じて、異なるオプションが表示されます。
  5. 包含タイプ リストから、包含 または 除外 を選択します。
  6. 説明 フィールドに、フィルターの説明を入力し、保存 をクリックします。
  7. コンテンツタイプ に入力した内容に応じて、必要なフィルターを作成するルールを追加します。
  8. 影響のあるリポジトリー タブをクリックして、どのリポジトリーがこのフィルターを使用するかを選択します。
  9. 新規バージョンの公開 をクリックして、フィルタリングされたリポジトリーを公開します。説明 フィールドに変更の説明を入力し、保存 をクリックします。

You can promote this Content View across all environments.

For CLI Users

  1. Add a filter to the Content View. Use the --inclusion false option to set the filter to an Exclude filter:

    # hammer content-view filter create \
    --name "Errata Filter" \
    --type erratum --content-view "Example_Content_View" \
    --description "My latest filter" \
    --inclusion false \
    --organization "My_Organization"
  2. Add a rule to the filter:

    # hammer content-view filter rule create \
    --content-view "Example_Content_View" \
    --content-view-filter "Errata Filter" \
    --start-date "YYYY-MM-DD" \
    --types enhancement,bugfix \
    --date-type updated \
    --organization "My_Organization"
  3. Publish the Content View:

    # hammer content-view publish \
    --name "Example_Content_View" \
    --description "Adding errata filter" \
    --organization "My_Organization"
  4. Promote the view across all environments:

    # hammer content-view version promote \
    --content-view "Example_Content_View" \
    --version 1 \
    --to-lifecycle-environment "Development" \
    --organization "My_Organization"
    # hammer content-view version promote \
    --content-view "Example_Content_View" \
    --version 1 \
    --to-lifecycle-environment "Testing" \
    --organization "My_Organization"
    # hammer content-view version promote \
    --content-view "Example_Content_View" \
    --version 1 \
    --to-lifecycle-environment "Production" \
    --organization "My_Organization"