Red Hat Training

A Red Hat training course is available for Red Hat Satellite

第11章 OSTree コンテンツの管理

OSTree は、起動可能で、変更しない、バージョン付きファイルシステムツリーを管理するツールです。ビルドシステムにカスタムの OSTree コンテンツを使用して、OSTree リポジトリーを静的 HTTP にエクスポートできます。Red Hat Enterprise Linux Atomic Server は、RPM ファイルから作成された OSTree コンテンツを使用して、オペレーティングシステムを最新の状態に保ちます。

Red Hat Satellite 6 を使用して、OSTree リポジトリーの OSTree ブランチを同期してブランチを管理することができます。

Satellite Server 6.4 では、OSTree 管理ツールがデフォルトで有効になっています。ツールを有効化する必要がある場合には、以下のコマンドを入力します。

# satellite-installer --katello-enable-ostree=true

11.1. 同期する Red Hat OSTree コンテンツの選択

Red Hat の CDN で OSTree コンテンツを選択して同期します。

手順

OSTree コンテンツを検索して同期するには以下の手順を実行します。

  1. Satellite Web UI で、コンテンツ > Red Hat リポジトリー に移動します。
  2. リストから OSTree のコンテンツタイプを選択します。
  3. 利用可能なリポジトリーペインで、Red Hat Enterprise Linux Atomic Host の製品グループの Red Hat Enterprise Linux Atomic Host Trees セットなど、使用する OSTree リポジトリーセットを特定します。
  4. 有効化 アイコンをクリックして、使用するリポジトリーを有効化します。
  5. コンテンツ > 製品 に移動して、Red Hat Enterprise Linux Atomic Host など、使用する製品をクリックします。
  6. このリポジトリーを選択して 同期開始 をクリックします。

同期の状態の表示

  • Satellite Web UI で、コンテンツ > 同期の状態 に移動し、たとえば、Red Hat Enterprise Linux Atomic Host を展開します。

CLI をご利用の場合

  1. Red Hat Enterprise Linux Server 製品の ostree リポジトリーを検索します。

    # hammer repository-set list \
    --product "Red Hat Enterprise Linux Atomic Host" \
    --organization "My_Organization" | grep "ostree"
  2. Red Hat Enterprise Linux Atomic Host や使用する製品の ostree リポジトリーを有効にします。

    # hammer repository-set enable \
    --product "Red Hat Enterprise Linux Atomic Host" \
    --name "Red Hat Enterprise Linux Atomic Host (Trees)" \
    --organization "My_Organization"
  3. 製品のリポジトリーの場所を特定し、同期します。

    # hammer repository list \
    --product "Red Hat Enterprise Linux Atomic Host" \
    --organization "My_Organization"
    # hammer repository synchronize \
    --name "Red Hat Enterprise Linux Atomic Host Trees" \
    --product "Red Hat Enterprise Linux Atomic Host" \
    --organization "My_Organization"

11.2. カスタム OSTree コンテンツのインポート

Red Hat の CDN から OSTree コンテンツをインポートするほかに、他のソースからコンテンツをインポートすることもできます。これには、公開済みの HTTP の場所が必要になります。

手順

カスタムの OSTree コンテンツをインポートするには、以下の手順を実行します。

  1. Satellite Web UI で コンテンツ > 製品 に移動して、新製品 をクリックします。
  2. 名前 フィールドには、OSTree コンテンツの名前を入力します。これにより、自動的に ラベル フィールドにデータが投入されます。
  3. オプション: GPG キー フィールドには、製品全体の GPG キーを入力します。
  4. 同期プラン フィールドには、製品を関連付けるコンテンツ同期プランの名前を入力します。
  5. 説明 フィールドには、製品の説明を入力し、保存 をクリックします。
  6. 製品の作成が完了したら、リポジトリーの作成 をクリックします。
  7. 名前 フィールドには、リポジトリーの名前を入力します。これにより、自動的に ラベル フィールドにデータが投入されます。
  8. タイプ の一覧から ostree を選択します。
  9. URL フィールドには、ソースとして使用するレジストリーの URL を入力します。たとえば http://www.example.com/rpm-ostree/ と入力します。
  10. 保存 をクリックします。
  11. リポジトリー作成が完了したら、新規リポジトリーを選択して、同期開始 をクリックして同期プロセスを開始します。

同期の状態を表示します。

  • Satellite Web UI で、コンテンツ > 同期の状態 に移動し、表示するエントリーを展開します。

CLI をご利用の場合

  1. カスタムの OSTree Content 製品を作成します。

    # hammer product create \
    --name "Custom OSTree Content" \
    --sync-plan "Example_Plan" \
    --description "OSTree Content" \
    --organization "My_Organization"
  2. OSTree 用のリポジトリーを作成します。

    # hammer repository create \
    --name "Custom OSTree" \
    --content-type "ostree" \
    --url "http://www.example.com/rpm-ostree/" \
    --product "OSTree Content" \
    --organization "My_Organization"
  3. リポジトリーを同期します。

    # hammer repository synchronize \
    --name "Custom OStree" \
    --product "OSTree Content" \
    --organization "My_Organization"

11.3. コンテンツビューによる OSTree コンテンツの管理

コンテンツビューを使用して、アプリケーションライフサイクルで OSTree ブランチを管理します。このプロセスでは、RPM および Puppet モジュールが使用するものと同じ公開とプロモーションのメソッドを使用します。

手順

OSTree のコンテンツビューを作成して、リポジトリーを追加するには、以下の手順を実行します。

  1. Satellite web UI で コンテンツ > コンテンツビュー に移動して、 新規ビューの作成 をクリックします。
  2. 名前 フィールドには、プレーンテキスト形式のビューの名前を入力します。これにより、自動的に ラベル フィールドにデータが投入されます。
  3. 説明 フィールドには、OSTree コンテンツビューの説明を加えます。
  4. 複合コンテンツビューを使用する場合には、複合ビュー のチェックボックスを選択します。
  5. 保存 をクリックします。
  6. OSTree コンテンツ タブに移動して、追加 をクリックします。
  7. 使用するコンテンツの OSTree リポジトリーを選択します。リポジトリーの追加 をクリックして、OSTree コンテンツをこのリポジトリーからコンテンツビューに追加します。
  8. バージョン に移動して、新規バージョンの公開 をクリックします。
  9. 説明 フィールドには、バージョンの説明を入力し、保存 をクリックします。

プロモート をクリックして、アプリケーションライフサイクルの環境でこのコンテンツビューをプロモートすることもできます。

CLI をご利用の場合

  1. リポジトリー ID の一覧を取得します。

    # hammer repository list --organization "_My_Organization_"
  2. コンテンツビューを作成して、リポジトリーを追加します。

    # hammer content-view create \
    --name "OSTree" \
    --description "OSTree for Red Hat Enterprise Linux Atomic Host" \
    --repository-ids 5 \
    --organization "My_Organization"
  3. ビューを公開します。

    # hammer content-view publish \
    --name "OSTree" \
    --description "Example Content View for the OSTree" \
    --organization "My_Organization"