自動化ハブの使用開始


Red Hat Ansible Automation Platform 2.3

Ansible コレクションコンテンツのデフォルトサーバーとしての Red Hat Automation Hub の設定

Red Hat Customer Content Services

概要

このガイドでは、Red Hat Automation Hub を認定 Ansible Collection コンテンツのデフォルトソースとして使用する際に必要な初期手順を説明します。
フィードバックの提供:
このドキュメントを改善するための提案がある場合、またはエラーを見つけた場合は、テクニカルサポート (https://access.redhat.com) に連絡し、Docs コンポーネントを使用して Ansible Automation Platform Jira プロジェクトで issue を作成してください。

はじめに

Red Hat Ansible Automation Hub は、Red Hat サブスクリプションをお持ちのお客様が、Red Hat および弊社のテクノロジーパートナーがサポートするコンテンツをすばやく見つけて使用できる場所を提供し、最も要求の厳しい環境にさらなる安心を提供します。

Ansible Galaxy クライアント ansible-galaxy は、コマンドラインからロールおよびコレクションを管理します。ansible-galaxy クライアントが認定済みでサポートされている Ansible Collection を可能な限り使用するようにするには、ansible.cfg ファイルを更新して、Ansible Collection のプライマリーソースとして Red Hat Automation Hub を使用します。

このガイドでは、Red Hat Automation Hub を認定 Ansible Collection コンテンツのデフォルトソースとして使用するように ansible.cfg ファイルを設定する際に必要な手順を説明します。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。まずは、マスター (master)、スレーブ (slave)、ブラックリスト (blacklist)、ホワイトリスト (whitelist) の 4 つの用語の置き換えから始めます。この取り組みは膨大な作業を要するため、用語の置き換えは、今後の複数のリリースにわたって段階的に実施されます。詳細は、Red Hat CTO である Chris Wright のメッセージ をご覧ください。

第1章 Red Hat Automation Hub API トークンの作成

コレクションをアップロードまたはダウンロードすることで、Automation Hub と対話できるようにする前に、API トークンを作成する必要があります。Automation Hub API トークンは、ansible-galaxy クライアントを Red Hat Automation Hub サーバーに対して認証します。

API トークンは、Automation Hub のトークン 管理 または Private Automation Hub (PAH)の API トークン管理 を使用して作成できます。

1.1. Red Hat Automation Hub API トークンの作成

コレクションをアップロードまたはダウンロードすることで、Automation Hub と対話できるようにする前に、API トークンを作成する必要があります。Automation Hub API トークンは、ansible-galaxy クライアントを Red Hat Automation Hub サーバーに対して認証します。

Automation Hub Token management を使用すると、API トークンを作成できます。

前提条件

  • Red Hat Ansible Automation Platform の有効なサブスクリプション認証情報。

手順

  1. https://cloud.redhat.com/ansible/automation-hub/token/ に移動します。
  2. Load Token をクリックします。
  3. copy アイコンをクリックして、API トークンをクリップボードにコピーします。
  4. API トークンをファイルに貼り付け、安全な場所に保存します。
重要

API トークンは、コンテンツを保護するために使用されるシークレットトークンです。API トークンを安全な場所に保存します。

API トークンは、Automation Hub をデフォルトのコレクションサーバーとして設定するか、ansible-galaxy コマンドラインツールを使用してコレクションをアップロードできるようになりました。

1.2. Private Automation Hub での API トークンの作成

プライベート Automation Hub の API トークン 管理 を使用して、API トークンを作成できます。

前提条件

  • Red Hat Ansible Automation Platform の有効なサブスクリプション認証情報。

手順

  1. PAH に移動します。
  2. サイドバーから、CollectionsAPI Token Management に移動します。
  3. Load Token をクリックします。
  4. copy アイコンをクリックして、API トークンをクリップボードにコピーします。
  5. API トークンをファイルに貼り付け、安全な場所に保存します。
重要

API トークンは、コンテンツを保護するために使用されるシークレットトークンです。API トークンを安全な場所に保存します。

API トークンは、Automation Hub をデフォルトのコレクションサーバーとして設定するか、ansible-galaxy コマンドラインツールを使用してコレクションをアップロードできるようになりました。

1.3. オフライントークンをアクティブな状態に維持

オフライントークンをアクティブな状態にしておくと、ユーザーがオフラインの場合でも、アプリケーションがユーザーの代わりにアクションを実行する必要がある場合に便利です。たとえば、ルーチンデータのバックアップです。

オフライントークンは、30 日の非アクティブ後に有効期限が切れます。オフライントークンを定期的に更新することで、オフライントークンの有効期限が切れないようにすることができます。

注記

オフライントークンの期限が切れたら、新しいトークンを要求する必要があります。

定期的に以下のコマンドを実行して、トークンの有効期限が切れないようにします。

curl https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token -d grant_type=refresh_token -d client_id="cloud-services" -d refresh_token="{{ user_token }}" --fail --silent --show-error --output /dev/null
Copy to Clipboard Toggle word wrap

第2章 Red Hat Automation Hub をコンテンツのプライマリーソースとして設定する

Ansible Certified Content Collections にアクセスするためのコンテンツのプライマリーソースとして Red Hat Automation Hub を設定します。Automation Hub は、コマンドラインインターフェイス (CLI) または Web コンソールで設定できます。

2.1. CLI を使用したコンテンツのプライマリーソースとしての Red Hat Automation Hub の設定

CLI を使用して、Red Hat Automation Hub をコンテンツのプライマリーソースとして設定します。Automation Hub を設定するには、ansible.cfg 設定ファイルを変更する必要があります。Automation Hub を使用すると、認定され、サポートされているコレクションにアクセスできます。

前提条件

Creating a new token revokes any previous tokens
generated for {PrivateHubName}. Ensure that you update any Controller or scripts that you created with the previous token.
Copy to Clipboard Toggle word wrap

手順

  1. [galaxy] セクション配下に server_list オプションを追加し、1 つ以上のサーバー名を指定します。
  2. 各サーバー名に新しいセクションを作成します。

    [galaxy_server._<server_name>_]
    Copy to Clipboard Toggle word wrap
  3. 各サーバー名に url オプションを設定します。サーバー URL に api/galaxy/ サブディレクトリーを含める必要があります。

    https://<server_fully_qualified_domain_name>/api/galaxy/
    Copy to Clipboard Toggle word wrap
  4. オプション: auth_url オプションを設定します。コミュニティーの Ansible Galaxy には auth_url が必要ありません。
  5. Automation Hub サーバーの API トークンを設定します。

以下の ansible.cfg 設定ファイルの例は、優先順位の高い順に複数のサーバーを設定する方法を示しています。Automation Hub がプライマリーソースとして設定され、Ansible Galaxy サーバーがセカンダリーソースとして設定されています。

ansible.cfg

[galaxy]
server_list = automation_hub, my_org_hub

[galaxy_server.automation_hub]
url=https://cloud.redhat.com/api/automation-hub/api/galaxy/ 
1
 
2

auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token

token=my_ah_token

[galaxy_server.my_org_hub]
url=https://automation.my_org/api/galaxy/ 
3

username=my_user
password=my_pass
Copy to Clipboard Toggle word wrap

1
サーバー URL の後に末尾のスラッシュ / を含めます。
2
Ansible Galaxy サーバー URL に /api/galaxy/ サブディレクトリーを含めます。
3
Automation Hub サーバーの URL に /api/galaxy/ サブディレクトリーを含めます。
注記

301 リダイレクトの受信を防ぐために、すべての API URL は末尾のスラッシュ / で終わる必要があります。

これで、CLI を使用して Automation Hub をプライマリーサーバーとして設定できました。次に、サポートされているコレクションのダウンロードとインストールに進むことができます。

Web コンソールを使用して、Red Hat Automation Hub をコンテンツのプライマリーソースとして設定します。Automation Hub を設定するには、認証情報を作成し、それを組織の Galaxy 認証情報フィールドに追加する必要があります。Automation Hub を使用すると、認定され、サポートされているコレクションにアクセスできます。

前提条件

Creating a new token revokes any previous tokens
generated for {PrivateHubName}. Ensure that you update any Controller or scripts that you created with the previous token.
Copy to Clipboard Toggle word wrap

手順

  1. Automation Controller に移動します。
  2. 新規認証情報を作成します。

    1. Credentials 画面で Add をクリックします。
    2. Name フィールドに新規の認証情報の名前を入力します。
    3. オプションで、説明を入力し、認証情報が関連付けられている組織の名前を入力するか、選択します。
    4. Organization で、認証情報を使用する組織を選択します。
    5. 認証情報のタイプとして Ansible Galaxy/Automation Hub API Token を選択します。
    6. Type Details に、前提条件で作成した Galaxy サーバー URL認証サーバー URL、および API トークン を入力します。
    7. Save をクリックします。
  3. 組織の Galaxy Credentials フィールドから作成した認証情報を選択します。

    1. AccessOrganizations に移動します。
    2. Galaxy 認証情報を追加する組織を選択します。
    3. Edit をクリックします。
    4. Galaxy 認証情報 で、Search アイコンをクリックします。
    5. Automation Hub 用に作成した認証情報を選択し、リストの先頭に配置します。
    6. オプション: Ansible Galaxy などのコンテンツのセカンダリーソースがある場合は、Automation Hub 用に作成した認証情報の後にこの認証情報を配置します。
    7. Select をクリックします。
    8. Save をクリックします。

検証

認証情報を検証するには、既存のソース管理管理 (SCM) ベースのプロジェクトを選択し、Refresh アイコンをクリックして更新します。

  1. プロジェクトリポジトリーに移動します。
  2. collections/requirements.yml ファイルを使用するプロジェクトを選択します。
  3. 更新アイコン [refresh icon] をクリックしてプロジェクトを更新します。

プロジェクトのステータスが Successful になると、認証情報は有効です。

Web コンソールを使用して Automation Hub をプライマリーサーバーとして設定したので、サポートされているコレクションのダウンロードとインストールに進むことができます。

法律上の通知

Copyright © 2025 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat