3.4. 外部データベースを使用した Automation Hub のインストール

以下の手順に従って、外部の管理データベースを使用して、Automation Hub のスタンドアロンインスタンスをインストールできます。これにより、Automation Hub サーバーが単一のマシンにインストールされ、Ansible Automation Platform インストーラーを使用してリモート PostgreSQL データベースがインストールされます。

3.4.1. 前提条件

  • Red Hat Ansible Automation Platform Product Software からプラットフォームインストーラーを選択して入手している。
  • ベースシステムの要件を満たすマシンにインストールしている。
  • すべてのパッケージが RHEL ノードの最新バージョンに更新されている。
警告

Ansible Automation Platform をインストールする前に、RHEL ノードを完全にアップグレードしないと、エラーが発生する可能性があります。

3.4.2. Red Hat Ansible Automation Platform インストーラーのインベントリーファイルの編集

Red Hat Ansible Automation Platform インストーラーのインベントリーファイルを使用して、インストールシナリオを指定できます。

手順

  1. インストーラーに移動します。

    1. [バンドルのインストーラー]

      $ cd ansible-automation-platform-setup-bundle-<latest-version>
    2. [オンラインインストーラー]

      $ cd ansible-automation-platform-setup-<latest-version>
  2. テキストエディターで inventory ファイルを開きます。
  3. inventory ファイルのパラメーターを編集して、インストールシナリオを指定します。以下の例に従ってください。

3.4.3. スタンドアロンの Automation Hub のインベントリーファイルの例

以下の例では、Automation Hub のスタンドアロンインスタンスをデプロイするためにインベントリーファイルを設定する方法を説明します。

重要
  • Red Hat Ansible Automation Platform または自動化ハブの場合: [automationhub] グループに自動化ハブホストを追加します。Automation Controller と Automation Hub を同じノードにインストールすることはできません。
  • [automationhub] ホストに到達可能な IP アドレスまたは完全修飾ドメイン名 (FQDN) を指定して、ユーザーが別のノードから Automation Hub のコンテンツを同期してインストールできるようにします。「localhost」は使用しないでください。
  • registry_username および registry_password に Red Hat Registry Service Account の認証情報を入力し、Red Hat コンテナーレジストリーにリンクします。
[automationcontroller]


[automationhub]
<FQDN> ansible_connection=local

[database]
host2

[all:vars]
registry_url='registry.redhat.io'
registry_username='<registry username>'
registry_password='<registry password>'

automationhub_admin_password= <PASSWORD>

automationhub_pg_host=''
automationhub_pg_port=''

automationhub_pg_database='automationhub'
automationhub_pg_username='automationhub'
automationhub_pg_password=<PASSWORD>
automationhub_pg_sslmode='prefer'

# The default install will deploy a TLS enabled Automation Hub.
# If for some reason this is not the behavior wanted one can
# disable TLS enabled deployment.
#
# automationhub_disable_https = False
# The default install will generate self-signed certificates for the Automation
# Hub service. If you are providing valid certificate via automationhub_ssl_cert
# and automationhub_ssl_key, one should toggle that value to True.
#
# automationhub_ssl_validate_certs = False
# SSL-related variables
# If set, this will install a custom CA certificate to the system trust store.
# custom_ca_cert=/path/to/ca.crt
# Certificate and key to install in Automation Hub node
# automationhub_ssl_cert=/path/to/automationhub.cert
# automationhub_ssl_key=/path/to/automationhub.key

3.4.4. Private Automation Hub での LDAP 設定

LDAP 認証用に Private Automation Hub を設定するには、Red Hat Ansible Automation Platform インストーラーインベントリーファイルで次の 6 つの変数を設定する必要があります。

  • automationhub_authentication_backend
  • automationhub_ldap_server_uri
  • automationhub_ldap_bind_dn
  • automationhub_ldap_bind_password
  • automationhub_ldap_user_search_base_dn
  • automationhub_ldap_group_search_base_dn

これらの変数のいずれかが欠落している場合、Ansible Automation インストーラーはインストールを完了しません。

3.4.4.1. インベントリーファイル変数の設定

LDAP 認証を使用して Private Automation Hub を設定する場合は、インストールプロセス中にインベントリーファイルに適切な変数を設定する必要があります。

前提条件

  • システムが Red Hat Ansible Automation Platform 2.2.1 以降を実行している。
  • Private Automation Hub 4.5.2 以降を使用している。

手順

  1. Red Hat Ansible Automation Platform インストーラーインベントリーファイルの編集 の手順に従って、インベントリーファイルにアクセスします。
  2. 次の例をガイドとして使用して、Ansible Automation Platform インベントリーファイルを設定します。

    automationhub_authentication_backend = "ldap"
    
    automationhub_ldap_server_uri = "ldap://ldap:389"   (for LDAPs use automationhub_ldap_server_uri = "ldaps://ldap-server-fqdn")
    automationhub_ldap_bind_dn = "cn=admin,dc=ansible,dc=com"
    automationhub_ldap_bind_password = "GoodNewsEveryone"
    automationhub_ldap_user_search_base_dn = "ou=people,dc=ansible,dc=com"
    automationhub_ldap_group_search_base_dn = "ou=people,dc=ansible,dc=com"
    注記

    次の変数は、他のオプションで設定しない限り、デフォルト値で設定されます。

    auth_ldap_user_search_scope= `SUBTREE'
    auth_ldap_user_search_filter= `(uid=%(user)s)`
    auth_ldap_group_search_scope= 'SUBTREE'
    auth_ldap_group_search_filter= '(objectClass=Group)`
    auth_ldap_group_type_class= 'django_auth_ldap.config:GroupOfNamesType'
  3. Private Automation Hub に追加のパラメーター (ユーザーグループ、スーパーユーザーアクセス、ミラーリングなど) を設定する予定がある場合は、次のセクションに進んでください。

3.4.4.2. 追加の LDAP パラメーターの設定

スーパーユーザーアクセス、ユーザーグループ、ミラーリング、またはその他の追加パラメーターを設定する予定がある場合は、それらを設定する YAML ファイルを ldap_extra_settings ディクショナリー内に作成できます。

手順

  1. 次のような ldap_extra_settings を含む YAML ファイルを作成します。

    #ldapextras.yml
    ---
    ldap_extra_settings:
      AUTH_LDAP_USER_ATTR_MAP: '{"first_name": "givenName", "last_name": "sn", "email": "mail"}'
    ...

    次に、Private Automation Hub のインストール中に setup.sh -e @ldapextras.yml を実行します。

  2. この例を使用して、LDAP グループのメンバーシップに基づいてスーパーユーザーフラグを設定します。

    #ldapextras.yml
    ---
    ldap_extra_settings:
      AUTH_LDAP_USER_FLAGS_BY_GROUP: {"is_superuser": "cn=pah-admins,ou=groups,dc=example,dc=com",}
    ...

    次に、Private Automation Hub のインストール中に setup.sh -e @ldapextras.yml を実行します。

  3. この例を使用して、スーパーユーザーアクセスを設定します。

    #ldapextras.yml
    ---
    ldap_extra_settings:
      AUTH_LDAP_USER_FLAGS_BY_GROUP: {"is_superuser": "cn=pah-admins,ou=groups,dc=example,dc=com",}
    ...

    次に、Private Automation Hub のインストール中に setup.sh -e @ldapextras.yml を実行します。

  4. この例を使用して、所属するすべての LDAP グループをミラーリングします。

    #ldapextras.yml
    ---
    ldap_extra_settings:
      AUTH_LDAP_MIRROR_GROUPS: True
    ...

    次に、Private Automation Hub のインストール中に setup.sh -e @ldapextras.yml を実行します。

  5. この例を使用して、LDAP ユーザー属性 (ユーザーの名、姓、電子メールアドレスなど) をマップします。

    #ldapextras.yml
    ---
    ldap_extra_settings:
      AUTH_LDAP_USER_ATTR_MAP: {"first_name": "givenName", "last_name": "sn", "email": "mail",}
    ...

    次に、Private Automation Hub のインストール中に setup.sh -e @ldapextras.yml を実行します。

  6. LDAP グループのメンバーシップに基づいてアクセスを許可または拒否するには、次の例を使用します。

    1. Private Automation Hub アクセスを許可する (たとえば、cn=pah-nosoupforyou,ou=groups,dc=example,dc=com グループのメンバー) には、以下を実行します。

      #ldapextras.yml
      ---
      ldap_extra_settings:
        AUTH_LDAP_REQUIRE_GROUP: "cn=pah-users,ou=groups,dc=example,dc=com'
      ...
    2. Private Automation Hub アクセスを拒否する (たとえば、cn=pah-nosoupforyou,ou=groups,dc=example,dc=com グループのメンバー) には、以下を実行します。

      #ldapextras.yml
      ---
      ldap_extra_settings:
        AUTH_LDAP_DENY_GROUP: 'cn=pah-nosoupforyou,ou=groups,dc=example,dc=com'
      ...

      次に、Private Automation Hub のインストール中に setup.sh -e @ldapextras.yml を実行します。

  7. この例を使用して、LDAP デバッグログを有効にします。

    #ldapextras.yml
    ---
    ldap_extra_settings:
      GALAXY_LDAP_LOGGING: True
    ...

    次に、Private Automation Hub のインストール中に setup.sh -e @ldapextras.yml を実行します。

    注記

    setup.sh を再実行することが現実的でない場合、またはデバッグログが短期間有効になっている場合は、Private Automation Hub の /etc/pulp/settings.py ファイルに GALAXY_LDAP_LOGGING: True を含む行を手動で追加できます。変更を有効にするには、pulpcore-api.servicenginx.service の両方を再起動します。人的ミスによる失敗を避けるため、この方法は必要な場合にのみ使用してください。

  8. この例では、変数 AUTH_LDAP_CACHE_TIMEOUT を設定して LDAP キャッシュを設定します。

    #ldapextras.yml
    ---
    ldap_extra_settings:
      AUTH_LDAP_CACHE_TIMEOUT: 3600
    ...

    次に、Private Automation Hub のインストール中に setup.sh -e @ldapextras.yml を実行します。

Private Automation Hub の /etc/pulp/settings.py ファイル内のすべての設定を表示できます。

3.4.5. 設定スクリプトフラグおよび追加変数

設定スクリプトを実行して Automation Controller をインストールする場合に、フラグおよび追加変数を指定することもできます。

表3.10 フラグ

引数説明

-h

ヘルプメッセージを表示して終了します。

-i INVENTORY_FILE

Ansible インベントリーファイルへのパス (デフォルト: inventory)

-e EXTRA_VARS

追加の Ansible 変数を key=value または YAML/JSON として設定します。

-b

インストールの代わりにデータベースのバックアップを実行します。

-r

インストールの代わりにデータベースの復元を行います。

-k

SECRET_KEY を生成 および 配布します。

この引数を使用して setup.sh スクリプトを実行すると、デフォルトで、新しい秘密鍵が Automation Controller に対して生成および配布されますが、自動化サービスカタログに対しては配布されません。

Automation Controller と自動化サービスカタログの両方に新しい秘密鍵を生成して配布するには、変数 rekey_catalog: true を指定します。

-- の区切り文字を使用して、適用する Ansible 引数を追加します。たとえば、./setup.sh -i my_awesome_inventory.yml -e matburt_is_country_gold=True — -K となります。

注記
  • -r を渡してデータベース復元を実行する場合は、EXTRA_VARS でデフォルト以外のパスを指定しない限り、デフォルト復元パスが使用されます。復元パスを指定する EXTRA_VAR を渡す以下の例を参照してください。

    ./setup.sh -e 'restore_backup_file=/path/to/nondefault/location' -r
  • -e bundle_install=false を渡すと、オンラインインストールを強制的に実行できます。

    $ ./setup.sh -e bundle_install=false

表3.11 追加変数

変数説明デフォルト

upgrade_ansible_with_tower

Automation Controller のインストール時に、Ansible も最新の状態であることを確認します。

False

create_preload_data

Tower のインストール時に、デモ組織、プロジェクト、認証情報、ジョブテンプレートなども作成します。

True

bundle_install_folder

バンドルからインストールする場合に、バンドルされているリポジトリーを配置する場所

var/lib/tower-bundle

nginx_disable_https

nginx で HTTPS トラフィックを無効にします。HTTPS の負荷をロードバランサーに分散する場合に便利です。

False

nginx_disable_hsts

Web セキュリティーポリシーメカニズム HSTS を無効にします。

False

nginx_http_port

nginx が HTTP をリッスンするように設定するポート

80

nginx_https_port

nginx が HTTPS をリッスンするように設定するポート

443

backup_dir

バックアップ時に使用する一時的な場所

/var/backups/tower/

restore_backup_file

復元元として使用する別のバックアップファイルを指定します。

なし

required_ram

Tower のインストールに必要な最小メモリー (テストインストールの場合に限り変更してください)

3750

min_open_fds

表示ファイルの説明に使用できる最小リソース (テストインストールの場合に限り変更してください)

なし

ignore_preflight_errors

プリフライトチェックを無視します。これはテンプレートや他のシステム以外のイメージにインストールするときに便利です (required_ram および min_open_fds をオーバーライドします)。

False

rekey_catalog

この変数を true に設定して setup.sh スクリプトを実行すると、デフォルトで、新しい秘密鍵が生成され、Automation Controller と自動化サービスカタログの両方に配布されます。

False

  • コアをアップグレードするには、以下を実行します。
./setup.sh -e upgrade_ansible_with_tower=1
  • nginx で処理する https を無効化するには、以下を実行します。
./setup.sh -e nginx_disable_https=true
  • バックアップファイルから復元時にデフォルトではないパスを指定する場合は、以下を実行します。
./setup.sh -e 'restore_backup_file=/path/to/nondefault/location' -r

3.4.6. Red Hat Ansible Automation Platform インストーラー設定スクリプトの実行

Private Automation Hub のインストールに必要なパラメーターを使用して inventory ファイルを更新したら、setup スクリプトを実行ができます。

手順

  1. setup.sh スクリプトを実行します。

    $ ./setup.sh

インストールが開始します。

3.4.7. Automation Controller インストールの確認

インストールが完了したら、inventory ファイルに挿入した管理者認証情報でログインして、Automation Controller が正常にインストールしたことを確認できます。

手順

  1. inventory ファイルのAutomation Controller ノードに指定した IP アドレスに移動します。
  2. inventory ファイルに設定した管理者認証情報を使用してログインします。
注記

Automation Controller サーバーはポート 80 (https://<TOWER_SERVER_NAME>/) からアクセスできますが、ポート 443 にリダイレクトされるため、443 も利用できる状態にする必要があります。

重要

インストールに失敗し、Red Hat Ansible Automation Platform の有効なライセンスを購入済みのお客様は、Red Hat カスタマーポータル (https://access.redhat.com/) から Ansible までお問い合せください。

Automation Controller へのログインに成功すると、Red Hat Ansible Automation Platform 2.2 のインストールが完了します。

3.4.7.1. 追加の Automation Hub の設定とリソース

追加の Automation Hub 設定については、以下のリソースを参照してください。

表3.12 Automation Controller を設定するための資料

リンク説明

Private Automation Hub でのユーザーアクセスの管理

Automation Hub のユーザーアクセスを設定します。

Automation Hub での Red Hat 認定コレクションおよび Ansible Galaxy コレクションの管理

Automation Hub にコンテンツを追加します。

Automation Hub でのプロプライエタリーコンテンツコレクションの公開

Automation Hub で社内で開発したコレクションを公開します。

3.4.8. Ansible Automation Platform 2.2 の次のステップ

Ansible Automation Platform を初めて使用するユーザーの場合でも、以前の Ansible コンテンツを最新版をインストールした Red Hat Ansible Automation Platform に移行する予定の既存の管理者の場合でも、次の手順を確認して、Ansible Automation Platform 2.2 の新機能を活用し始めてみてください。

3.4.8.1. Ansible Automation Platform 2.2 へのデータの移行

プラットフォーム管理者が Ansible Automation Platform 2.2 へのアップグレードを行う場合は、完了する前にデータを新しいインスタンスに移行する追加の手順が必要になる場合があります。

3.4.8.1.1. 従来の仮想環境 (venvs) から自動化実行環境への移行

Ansible Automation Platform 2.2 は、カスタム Python 仮想環境 (venvs) よりも、自動化実行環境 (Ansible 自動化の実行およびスケーリングに必要なコンポーネントをパッケージ化するコンテナー化されたイメージ) を優先するようになっています。これには、Ansible Core、Ansible Content Collections、Python の依存関係、Red Hat Enterprise Linux UBI 8、およびその他のパッケージの依存関係が含まれます。

venv を実行環境に移行する場合は、(1) awx-manage コマンドを使用して、元のインスタンスから venv のリストを一覧表示してエクスポートし、(2) ansible-builder を使用して実行環境を作成する必要があります。詳細は、自動化実行環境へのアップグレードガイド および 実行環境の作成および消費 を参照してください。

3.4.8.1.2. Ansible Builder を使用した Ansible Engine 2.9 イメージへの移行

Ansible Automation Platform 2.2 で使用するために Ansible Engine2.9 イメージを移行するには、ansible-builder ツールで、自動化実行環境で使用するためにイメージ (カスタムプラグインおよび依存関係を含む) を再構築するプロセスを自動化します。Ansible Builder を使用して実行環境を構築する方法の詳細は、実行環境の作成および消費 を参照してください。

3.4.8.1.3. Ansible Core 2.13 への移行

Ansible Core 2.13 にアップグレードする場合に、最新版の Ansible Core でサポートされるようにするには、Playbook、プラグイン、または Ansible インフラストラクチャーの他の部分を更新する必要があります。Ansible コンテンツを更新して Ansible Core 2.13 との互換性を確保する手順は、Ansible-core 2.13 移植ガイド を参照してください。

3.4.8.2. 自動化メッシュを使用した自動化スケールアップ

Red Hat Ansible Automation Platform の自動化メッシュコンポーネントは、マルチサイトのデプロイメント全体に自動化を分散するプロセスを簡素化します。IT 環境が複数に分離されている企業の場合、自動化メッシュは、ピアツーピアメッシュ通信ネットワークを使用して実行ノード全体に自動化をデプロイしてスケールアップするための一貫性があり、信頼性の高い方法を提供します。

バージョン 1.x から最新バージョンの Ansible Automation Platform にアップグレードする場合は、データをレガシーの分離ノードから自動化メッシュに必要な実行ノードに移行する必要があります。ハイブリッドノードとコントロールノードのネットワークを計画して、Ansible Automation Platform インストーラーにあるインベントリーファイルを編集して、メッシュ関連の値を各実行ノードに割り当てることで、自動化メッシュを実装できます。

分離ノードから実行ノードに移行する方法については、アップグレードおよび移行ガイド を参照してください。

自動化メッシュと、ご使用の環境に合わせて自動化メッシュを設計するさまざまな方法については、Red Hat Ansible Automation Platform 化メッシュガイド を参照してください。