16.5. カスタムファイルタイプリポジトリーからホストにファイルをダウンロードする
curl -O を使用して HTTPS 経由でクライアントにファイルをダウンロードできます。また、リポジトリーの Unprotected オプションが選択されている場合は、オプションで HTTP 経由でもダウンロードできます。
前提条件
- カスタムファイルタイプリポジトリーがある。詳細は、「カスタムファイルタイプリポジトリーの作成」 を参照してください。
- ファイルタイプリポジトリーから、クライアントにダウンロードするファイル名を把握しておく。
HTTPS を使用するには、クライアントで以下の証明書を用意しておく。
-
katello-server-ca.crt。詳細は、Red Hat Satellite ユーザーの認証の設定 の Satellite Web UI を使用して Katello ルート CA 証明書をインポートする を参照してください。 - 組織のデバッグ証明書。詳細は、Red Hat Satellite の管理 の 組織デバッグ証明書の作成 を参照してください。
-
手順
- Satellite Web UI で、Content > Products に移動します。
- カスタム製品の名前を選択します。
- ファイルタイプリポジトリーの名前を選択します。
- Unprotected チェックボックスを選択して、HTTP 経由で公開されているリポジトリーにアクセスしてください。
- Published At URL をコピーします。
クライアントで、Satellite Server からファイルをダウンロードします。
HTTPS の場合:
# curl \ --cacert ./_katello-server-ca.crt \ --cert ./_My_Organization_key-cert.pem \ --remote-name \ https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_FileHTTP の場合:
# curl \ --remote-name \ http://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_File
CLI 手順
ファイルタイプリポジトリーをリスト表示します。
$ hammer repository list --content-type file ---|------------|-------------------|--------------|---- ID | NAME | PRODUCT | CONTENT TYPE | URL ---|------------|-------------------|--------------|---- 7 | My_Files | My_File_Product | file | ---|------------|-------------------|--------------|----リポジトリー情報を表示します。
$ hammer repository info \ --name "My_Files" \ --organization-id My_Organization_ID \ --product "My_File_Product"Unprotected が有効になっている場合、出力は次のようになります。
Publish Via HTTP: yes Published At: https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_File_Product_Label/My_Files_Label/Unprotected が有効になっていない場合、出力は次のようになります。
Publish Via HTTP: no Published At: https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_File_Product_Label/My_Files_Label/クライアントで、Satellite Server からファイルをダウンロードします。
HTTPS の場合:
# curl \ --cacert ./_katello-server-ca.crt \ --cert ./_My_Organization_key-cert.pem \ --remote-name \ https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_FileHTTP の場合:
# curl \ --remote-name \ http://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_File