第3章 Red Hat Ansible Automation Platform のインストール
Ansible Automation Platform はモジュラープラットフォームであり、Automation Hub などの他の Automation Platform コンポーネントとともに Automation Controller をデプロイできます。Ansible Automation Platform で提供されるコンポーネントの詳細は、Red Hat Ansible Automation Platform 計画ガイドの Red Hat Ansible Automation Platform コンポーネント を参照してください。
Red Hat Ansible Automation Platform でサポートされているインストールシナリオは多数あります。Red Hat Ansible Automation Platform をインストールするには、インベントリーファイルのパラメーターを編集して、以下の例のいずれかを使用してインストールシナリオを指定する必要があります。
- 内部データベースを備えたスタンドアロン Automation Controller
- 外部 (インストーラー管理) データベースを備えた単一の Automation Controller
- 外部 (顧客提供) データベースを備えた単一の Automation Controller
- 外部 (インストーラー管理) データベースを使用する Ansible Automation Platform
- 外部 (顧客提供) データベースを使用する Ansible Automation Platform
- 内部データベースを備えたスタンドアロンの Automation Hub
- 外部 (インストーラ管理) データベースを備えた単一の Automation Hub
- 外部 (顧客提供) データベースを備えた単一の Automation Hub
- Private Automation Hub での LDAP 設定
3.1. Red Hat Ansible Automation Platform インストーラーのインベントリーファイルの編集
Red Hat Ansible Automation Platform インストーラーのインベントリーファイルを使用して、インストールシナリオを指定できます。
手順
インストーラーに移動します。
[RPM インストールされたパッケージ]
$ cd /opt/ansible-automation-platform/installer/
[バンドルのインストーラー]
$ cd ansible-automation-platform-setup-bundle-<latest-version>
[オンラインインストーラー]
$ cd ansible-automation-platform-setup-<latest-version>
-
テキストエディターで
inventory
ファイルを開きます。 -
inventory
ファイルのパラメーターを編集して、インストールシナリオを指定します。サポートされている インストールシナリオの例 のいずれかを使用して、inventory
ファイルを更新します。
関連情報
Ansible インストールインベントリーファイルで使用される定義済み変数の包括的なリストについては、インベントリーファイル変数 を参照してください。
3.1.1. インストールシナリオに基づくインベントリーファイルの例
Red Hat は、Ansible Automation Platform のいくつかのインストールシナリオをサポートしています。次の例を確認し、希望するインストールシナリオに適したものを選択してください。
-
Red Hat Ansible Automation Platform または自動化ハブの場合:
[automationhub]
グループに自動化ハブホストを追加します。 -
内部データベースの場合:
[database]
を使用して、Ansible Automation Platform クラスター内の別のホストを参照することはできません。インストールするデータベースホストのセットは一意のホストである必要があります。 - 実稼働環境または顧客環境のバージョンの Ansible Automation Platform では、Automation Controller と Automation Hub を同じノードにインストールしないでください。これにより、競合の問題や大量のリソース使用が発生する可能性があります。
[automationhub]
および[automationcontroller]
ホストに到達可能な IP アドレスまたは完全修飾ドメイン名 (FQDN) を指定して、ユーザーが別のノードから Automation Hub のコンテンツを同期してインストールできるようにします。FQDN には
-
記号または_
記号を含めることはできません。正しく処理されません。localhost
は使用しないでください。-
pg_password
には特殊文字を使用しないでください。セットアップが失敗する可能性があります。 -
registry_username
およびregistry_password
に Red Hat Registry Service Account の認証情報を入力し、Red Hat コンテナーレジストリーにリンクします。 -
インベントリーファイル変数
registry_username
およびregistry_password は
、非バンドルインストーラーを使用する場合にのみ必要です。
3.1.1.1. 内部データベースを備えたスタンドアロン Automation Controller
この例を使用して、インベントリーファイルに入力し、Red Hat Ansible Automation Platform をインストールします。このインストールインベントリーファイルには、内部データベースを持つ単一の Automation Controller ノードが含まれています。
[automationcontroller] controller.acme.org [all:vars] admin_password='<password>' pg_host='' pg_port='5432' pg_database='awx' pg_username='awx' pg_password='<password>' pg_sslmode='prefer' # set to 'verify-full' for client-side enforced SSL registry_url='registry.redhat.io' registry_username='<registry username>' registry_password='<registry password>' # 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 nginx for the web UI and API # web_server_ssl_cert=/path/to/tower.cert # web_server_ssl_key=/path/to/tower.key # Server-side SSL settings for PostgreSQL (when we are installing it). # postgres_use_ssl=False # postgres_ssl_cert=/path/to/pgsql.crt # postgres_ssl_key=/path/to/pgsql.key
3.1.1.2. 外部 (インストーラー管理) データベースを備えた単一の Automation Controller
この例を使用して、インベントリーファイルに入力し、Red Hat Ansible Automation Platform をインストールします。このインストールインベントリーファイルには、別のノードに外部データベースを持つ単一の Automation Controller ノードが含まれています。
[automationcontroller] controller.acme.org [database] data.acme.org [all:vars] admin_password='<password>' pg_host='data.acme.org' pg_port='5432' pg_database='awx' pg_username='awx' pg_password='<password>' pg_sslmode='prefer' # set to 'verify-full' for client-side enforced SSL registry_url='registry.redhat.io' registry_username='<registry username>' registry_password='<registry password>' # 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 nginx for the web UI and API # web_server_ssl_cert=/path/to/tower.cert # web_server_ssl_key=/path/to/tower.key # Server-side SSL settings for PostgreSQL (when we are installing it). # postgres_use_ssl=False # postgres_ssl_cert=/path/to/pgsql.crt # postgres_ssl_key=/path/to/pgsql.key
3.1.1.3. 外部 (顧客提供) データベースを備えた単一の Automation Controller
この例を使用して、インベントリーファイルに入力し、Red Hat Ansible Automation Platform をインストールします。このインストールインベントリーファイルには、プラットフォームインストーラーによって管理されない別のノード上の外部データベースを持つ単一の Automation Controller ノードが含まれています。
この例では、データベースグループの下にホストがありません。これは、データベースがすでに存在し、別の場所で管理されていることをインストーラーに示します。
[automationcontroller] controller.acme.org [database] [all:vars] admin_password='<password>' pg_host='data.acme.org' pg_port='5432' pg_database='awx' pg_username='awx' pg_password='<password>' pg_sslmode='prefer' # set to 'verify-full' for client-side enforced SSL registry_url='registry.redhat.io' registry_username='<registry username>' registry_password='<registry password>' # 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 nginx for the web UI and API # web_server_ssl_cert=/path/to/tower.cert # web_server_ssl_key=/path/to/tower.key # Server-side SSL settings for PostgreSQL (when we are installing it). # postgres_use_ssl=False # postgres_ssl_cert=/path/to/pgsql.crt # postgres_ssl_key=/path/to/pgsql.key
3.1.1.4. 外部 (インストーラー管理) データベースを使用する Ansible Automation Platform
この例を使用して、インベントリーファイルに入力し、Ansible Automation Platform をインストールします。このインストールインベントリーファイルには、2 つの Automation Controller ノード、2 つの実行ノード、および外部管理データベースを備えた Automation Hub が含まれています。
# Automation Controller Nodes # There are two valid node_types that can be assigned for this group. # A node_type=control implies that the node will only be able to run # project and inventory updates, but not regular jobs. # A node_type=hybrid will have the ability to run everything. # If you do not define the node_type, it defaults to hybrid. # # control.example node_type=control # hybrid.example node_type=hybrid # hybrid2.example <- this will default to hybrid [automationcontroller] controller1.acme.org node_type=control controller2.acme.org node_type=control # Execution Nodes # There are two valid node_types that can be assigned for this group. # A node_type=hop implies that the node will forward jobs to an execution node. # A node_type=execution implies that the node will be able to run jobs. # If you do not define the node_type, it defaults to execution. # # hop.example node_type=hop # execution.example node_type=execution # execution2.example <- this will default to execution [execution_nodes] execution1.acme.org node_type=execution execution2.acme.org node_type=execution [automationhub] automationhub.acme.org [database] data.acme.org [all:vars] admin_password='<password>' pg_host='data.acme.org' pg_port='5432' pg_database='awx' pg_username='awx' pg_password='<password>' pg_sslmode='prefer' # set to 'verify-full' for client-side enforced SSL registry_url='registry.redhat.io' registry_username='<registry username>' registry_password='<registry password>' # Receptor Configuration # receptor_listener_port=27199 # Automation Hub Configuration # automationhub_admin_password='<password>' automationhub_pg_host='data.acme.org' automationhub_pg_port='5432' 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 nginx for the web UI and API # web_server_ssl_cert=/path/to/tower.cert # web_server_ssl_key=/path/to/tower.key # Certificate and key to install in Automation Hub node # automationhub_ssl_cert=/path/to/automationhub.cert # automationhub_ssl_key=/path/to/automationhub.key # Server-side SSL settings for PostgreSQL (when we are installing it). # postgres_use_ssl=False # postgres_ssl_cert=/path/to/pgsql.crt # postgres_ssl_key=/path/to/pgsql.key
3.1.1.5. 外部 (顧客提供) データベースを使用する Ansible Automation Platform
この例を使用して、インベントリーファイルに入力し、Red Hat Ansible Automation Platform をインストールします。このインストールインベントリーファイルには、各ノードタイプが 1 つずつ含まれています (コントロール、ハイブリッド、ホップ、および実行、およびプラットフォームインストーラーが管理しない外部マネージドデータベースを使用する Automation Hub)。
この例では、データベースグループの下にホストがありません。これは、データベースがすでに存在し、別の場所で管理されていることをインストーラーに示します。
# Automation Controller Nodes # There are two valid node_types that can be assigned for this group. # A node_type=control implies that the node will only be able to run # project and inventory updates, but not regular jobs. # A node_type=hybrid will have the ability to run everything. # If you do not define the node_type, it defaults to hybrid. # # control.example node_type=control # hybrid.example node_type=hybrid # hybrid2.example <- this will default to hybrid [automationcontroller] hybrid1.acme.org node_type=hybrid controller1.acme.org node_type=control # Execution Nodes # There are two valid node_types that can be assigned for this group. # A node_type=hop implies that the node will forward jobs to an execution node. # A node_type=execution implies that the node will be able to run jobs. # If you do not define the node_type, it defaults to execution. # # hop.example node_type=hop # execution.example node_type=execution # execution2.example <- this will default to execution [execution_nodes] hop1.acme.org node_type=hop execution1.acme.org node_type=execution [automationhub] automationhub.acme.org [database] [all:vars] admin_password='<password>' pg_host='data.acme.org' pg_port='5432' pg_database='awx' pg_username='awx' pg_password='<password>' pg_sslmode='prefer' # set to 'verify-full' for client-side enforced SSL registry_url='registry.redhat.io' registry_username='<registry username>' registry_password='<registry password>' # Receptor Configuration # receptor_listener_port=27199 # Automation Hub Configuration # automationhub_admin_password='<password>' automationhub_pg_host='data.acme.org' automationhub_pg_port='5432' 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 nginx for the web UI and API # web_server_ssl_cert=/path/to/tower.cert # web_server_ssl_key=/path/to/tower.key # Certificate and key to install in Automation Hub node # automationhub_ssl_cert=/path/to/automationhub.cert # automationhub_ssl_key=/path/to/automationhub.key # Server-side SSL settings for PostgreSQL (when we are installing it). # postgres_use_ssl=False # postgres_ssl_cert=/path/to/pgsql.crt # postgres_ssl_key=/path/to/pgsql.key
3.1.1.6. 内部データベースを備えたスタンドアロンの Automation Hub
この例を使用して、インベントリーファイルにデータを入力し、内部データベースを使用して Automation Hub のスタンドアロンインスタンスをデプロイします。
[automationcontroller] [automationhub] automationhub.acme.org ansible_connection=local [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='5432' 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.1.1.7. 外部 (インストーラ管理) データベースを備えた単一の Automation Hub
この例を使用して、インベントリーファイルにデータを入力し、外部 (インストーラー管理) データベースを使用して Automation Hub の単一インスタンスをデプロイします。
[automationcontroller] [automationhub] automationhub.acme.org [database] data.acme.org [all:vars] registry_url='registry.redhat.io' registry_username='<registry username>' registry_password='<registry password>' automationhub_admin_password= <PASSWORD> automationhub_pg_host='data.acme.org' automationhub_pg_port='5432' 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.1.1.8. 外部 (顧客提供) データベースを備えた単一の Automation Hub
この例を使用してインベントリーファイルにデータを入力し、プラットフォームインストーラーが管理しない外部データベースを使用して Automation Hub の単一インスタンスをデプロイメントします。
この例では、データベースグループの下にホストがありません。これは、データベースがすでに存在し、別の場所で管理されていることをインストーラーに示します。
[automationcontroller] [automationhub] automationhub.acme.org [database] [all:vars] registry_url='registry.redhat.io' registry_username='<registry username>' registry_password='<registry password>' automationhub_admin_password= <PASSWORD> automationhub_pg_host='data.acme.org' automationhub_pg_port='5432' 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.1.1.9. 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.1.1.9.1. インベントリーファイル変数の設定
LDAP 認証を使用して Private Automation Hub を設定する場合は、インストールプロセス中にインベントリーファイルに適切な変数を設定する必要があります。
手順
- Red Hat Ansible Automation Platform インストーラーインベントリーファイルの編集 の手順に従って、インベントリーファイルにアクセスします。
次の例をガイドとして使用して、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'
- オプション: ユーザーグループ、スーパーユーザーアクセス、ミラーリングなどの追加パラメーターを Private Automation Hub にセットアップします。このオプションの手順を完了するには、追加の LDAP パラメーターの設定 に進みます。
3.1.1.9.2. 追加の LDAP パラメーターの設定
スーパーユーザーアクセス、ユーザーグループ、ミラーリング、またはその他の追加パラメーターを設定する予定がある場合は、それらを設定する YAML ファイルを ldap_extra_settings
ディクショナリー内に作成できます。
手順
ldap_extra_settings
を含む YAML ファイルを作成します。以下に例を示します。
#ldapextras.yml --- ldap_extra_settings: <LDAP_parameter>: <Values> ...
セットアップに必要なパラメーターを追加します。次の例では、
ldap_extra_settings
で設定できる LDAP パラメーターについて説明します。この例を使用して、LDAP グループのメンバーシップに基づいてスーパーユーザーフラグを設定します。
#ldapextras.yml --- ldap_extra_settings: AUTH_LDAP_USER_FLAGS_BY_GROUP: {"is_superuser": "cn=pah-admins,ou=groups,dc=example,dc=com",} ...
この例を使用して、スーパーユーザーアクセスを設定します。
#ldapextras.yml --- ldap_extra_settings: AUTH_LDAP_USER_FLAGS_BY_GROUP: {"is_superuser": "cn=pah-admins,ou=groups,dc=example,dc=com",} ...
この例を使用して、所属するすべての LDAP グループをミラーリングします。
#ldapextras.yml --- ldap_extra_settings: AUTH_LDAP_MIRROR_GROUPS: True ...
この例を使用して、LDAP ユーザー属性 (ユーザーの名、姓、電子メールアドレスなど) をマップします。
#ldapextras.yml --- ldap_extra_settings: AUTH_LDAP_USER_ATTR_MAP: {"first_name": "givenName", "last_name": "sn", "email": "mail",} ...
LDAP グループのメンバーシップに基づいて、アクセスを許可または拒否するには、次の例を使用します。
Private Automation Hub アクセスを許可する (たとえば、
cn=pah-nosoupforyou,ou=groups,dc=example,dc=com
グループのメンバー) には、以下を実行します。#ldapextras.yml --- ldap_extra_settings: AUTH_LDAP_REQUIRE_GROUP: 'cn=pah-nosoupforyou,ou=groups,dc=example,dc=com' ...
Private Automation Hub アクセスを拒否する (たとえば、
cn=pah-nosoupforyou,ou=groups,dc=example,dc=com
グループのメンバー) には、以下を実行します。#ldapextras.yml --- ldap_extra_settings: AUTH_LDAP_REQUIRE_GROUP: 'cn=pah-nosoupforyou,ou=groups,dc=example,dc=com' ...
この例を使用して、LDAP デバッグログを有効にします。
#ldapextras.yml --- ldap_extra_settings: GALAXY_LDAP_LOGGING: True ...
注記setup.sh
を再実行することが現実的でない場合、またはデバッグログが短期間有効になっている場合は、Private Automation Hub の/etc/pulp/settings.py
ファイルにGALAXY_LDAP_LOGGING: True
を含む行を手動で追加できます。変更を有効にするには、pulpcore-api.service
とnginx.service
の両方を再起動します。人的ミスによる失敗を避けるため、この方法は必要な場合にのみ使用してください。この例では、変数
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
ファイル内のすべての設定を表示できることを確認します。