3.2. インストールシナリオに基づくインベントリーファイルの例
Red Hat は、Ansible Automation Platform のいくつかのインストールシナリオをサポートしています。サンプルファイルをベースとして使用し、独自のインベントリーファイルを開発することも、希望するインストールシナリオに最も近いサンプルを使用することもできます。
3.2.1. インストールシナリオに基づいたインベントリーファイルの推奨事項
Ansible Automation Platform のインストール方法を選択する前に、次の推奨事項を確認してください。これらの推奨事項をよく理解しておくと、インストールプロセスが効率化されます。
到達可能な IP アドレスまたは完全修飾ドメイン名 (FQDN) をホストに指定して、ユーザーが別のノードから Automation Hub のコンテンツを同期してインストールできるようにします。
FQDN には
-
記号または_
記号を含めることはできません。正しく処理されません。localhost
は使用しないでください。-
admin
は、Ansible Automation Platform への初回ログイン時のデフォルトのユーザー ID であり、インベントリーファイルで変更することはできません。 -
pg_password
での特殊文字の使用は制限されています。!
、#
、0
、および@
文字がサポートされています。他の特殊文字を使用すると、セットアップが失敗する可能性があります。 -
registry_username
およびregistry_password
に Red Hat Registry Service Account の認証情報を入力し、Red Hat コンテナーレジストリーにリンクします。 -
インベントリーファイル変数
registry_username
およびregistry_password
は、バンドル以外のインストーラーを使用する場合にのみ必要です。
3.2.1.1. 単一のプラットフォームゲートウェイおよび Automation Controller と、外部 (インストーラー管理) データベース
単一のプラットフォームゲートウェイと Automation Controller のインスタンスを、外部 (インストーラー管理) データベースとともにデプロイするには、この例を使用して、インベントリーファイル内で最小限必要なものを確認してください。
[automationcontroller] controller.example.com [automationgateway] gateway.example.com [database] data.example.com [all:vars] admin_password='<password>' redis_mode=standalone pg_host='data.example.com' 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>' # Automation Gateway configuration automationgateway_admin_password='' automationgateway_pg_host='data.example.com' automationgateway_pg_port=5432 automationgateway_pg_database='automationgateway' automationgateway_pg_username='automationgateway' automationgateway_pg_password='' automationgateway_pg_sslmode='prefer' # The main automation gateway URL that clients will connect to (e.g. https://<load balancer host>). # If not specified, the first node in the [automationgateway] group will be used when needed. # automationgateway_main_url = '' # Certificate and key to install in Automation Gateway # automationgateway_ssl_cert=/path/to/automationgateway.cert # automationgateway_ssl_key=/path/to/automationgateway.key # 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
[automationcontroller]
controller.example.com
[automationgateway]
gateway.example.com
[database]
data.example.com
[all:vars]
admin_password='<password>'
redis_mode=standalone
pg_host='data.example.com'
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>'
# Automation Gateway configuration
automationgateway_admin_password=''
automationgateway_pg_host='data.example.com'
automationgateway_pg_port=5432
automationgateway_pg_database='automationgateway'
automationgateway_pg_username='automationgateway'
automationgateway_pg_password=''
automationgateway_pg_sslmode='prefer'
# The main automation gateway URL that clients will connect to (e.g. https://<load balancer host>).
# If not specified, the first node in the [automationgateway] group will be used when needed.
# automationgateway_main_url = ''
# Certificate and key to install in Automation Gateway
# automationgateway_ssl_cert=/path/to/automationgateway.cert
# automationgateway_ssl_key=/path/to/automationgateway.key
# 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.2.1.2. 単一のプラットフォームゲートウェイ、Automation Controller、および Automation Hub と、外部 (インストーラー管理) データベース
この例では、インベントリーファイルにデータを入力し、単一のプラットフォームゲートウェイ、Automation Controller、Automation Hub のインスタンスを、外部 (インストーラー管理) データベースとともにデプロイします。
[automationcontroller] controller.example.com [automationhub] automationhub.example.com [automationgateway] gateway.example.com [database] data.example.com [all:vars] admin_password='<password>' redis_mode=standalone pg_host='data.example.com' 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>' automationhub_admin_password= <PASSWORD> automationhub_pg_host='data.example.com' 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 # Automation Gateway configuration automationgateway_admin_password='' automationgateway_pg_host='' automationgateway_pg_port=5432 automationgateway_pg_database='automationgateway' automationgateway_pg_username='automationgateway' automationgateway_pg_password='' automationgateway_pg_sslmode='prefer' # The main automation gateway URL that clients will connect to (e.g. https://<load balancer host>). # If not specified, the first node in the [automationgateway] group will be used when needed. # automationgateway_main_url = '' # Certificate and key to install in Automation Gateway # automationgateway_ssl_cert=/path/to/automationgateway.cert # automationgateway_ssl_key=/path/to/automationgateway.key # 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
[automationcontroller]
controller.example.com
[automationhub]
automationhub.example.com
[automationgateway]
gateway.example.com
[database]
data.example.com
[all:vars]
admin_password='<password>'
redis_mode=standalone
pg_host='data.example.com'
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>'
automationhub_admin_password= <PASSWORD>
automationhub_pg_host='data.example.com'
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
# Automation Gateway configuration
automationgateway_admin_password=''
automationgateway_pg_host=''
automationgateway_pg_port=5432
automationgateway_pg_database='automationgateway'
automationgateway_pg_username='automationgateway'
automationgateway_pg_password=''
automationgateway_pg_sslmode='prefer'
# The main automation gateway URL that clients will connect to (e.g. https://<load balancer host>).
# If not specified, the first node in the [automationgateway] group will be used when needed.
# automationgateway_main_url = ''
# Certificate and key to install in Automation Gateway
# automationgateway_ssl_cert=/path/to/automationgateway.cert
# automationgateway_ssl_key=/path/to/automationgateway.key
# 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.2.1.3. 単一のプラットフォームゲートウェイ、Automation Controller、Automation Hub、および Event-Driven Ansible Controller と、外部 (インストーラー管理) データベース
この例では、インベントリーファイルにデータを入力し、単一のプラットフォームゲートウェイ、Automation Controller、Automation Hub、および Event-Driven Ansible Controller のインスタンスを、外部 (インストーラー管理) データベースとともにデプロイします。
- このシナリオでは、Event-Driven Ansible Controller を正常にデプロイするために、Automation Controller 2.4 以降が必要です。
- Event-Driven Ansible Controller は別のサーバーにインストールする必要があります。Automation Hub および Automation Controller と同じホストにインストールすることはできません。
-
標準条件下で Event-Driven Ansible ルールブックをアクティブ化すると、約 250 MB のメモリーが使用されます。ただし、実際のメモリー消費量は、ルールの複雑さと処理されるイベントのボリュームおよびサイズによって大幅に異なる可能性があります。大量のイベントが予想される場合やルールブックの複雑さが高いシナリオでは、ステージング環境でのリソース使用量の事前評価を行います。これにより、アクティベーションの最大数をリソース容量に基づいて決定できます。次の例では、デフォルトの
automatededacontroller_max_running_activations
設定は 12 ですが、容量に応じて調整できます。
[automationcontroller] controller.example.com [automationhub] automationhub.example.com [automationedacontroller] automationedacontroller.example.com [automationgateway] gateway.example.com [database] data.example.com [all:vars] admin_password='<password>' redis_mode=standalone pg_host='data.example.com' 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>' # Automation hub configuration automationhub_admin_password= <PASSWORD> automationhub_pg_host='data.example.com' automationhub_pg_port=5432 automationhub_pg_database='automationhub' automationhub_pg_username='automationhub' automationhub_pg_password=<PASSWORD> automationhub_pg_sslmode='prefer' # Automation Event-Driven Ansible controller configuration automationedacontroller_admin_password='<eda-password>' automationedacontroller_pg_host='data.example.com' automationedacontroller_pg_port=5432 automationedacontroller_pg_database='automationedacontroller' automationedacontroller_pg_username='automationedacontroller' automationedacontroller_pg_password='<password>' # Keystore file to install in SSO node # sso_custom_keystore_file='/path/to/sso.jks' # This install will deploy SSO with sso_use_https=True # Keystore password is required for https enabled SSO sso_keystore_password='' # This 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 # Automation Gateway configuration automationgateway_admin_password='' automationgateway_pg_host='' automationgateway_pg_port=5432 automationgateway_pg_database='automationgateway' automationgateway_pg_username='automationgateway' automationgateway_pg_password='' automationgateway_pg_sslmode='prefer' # The main automation gateway URL that clients will connect to (e.g. https://<load balancer host>). # If not specified, the first node in the [automationgateway] group will be used when needed. # automationgateway_main_url = '' # Certificate and key to install in Automation Gateway # automationgateway_ssl_cert=/path/to/automationgateway.cert # automationgateway_ssl_key=/path/to/automationgateway.key # 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 # Boolean flag used to verify Automation Controller's # web certificates when making calls from Automation Event-Driven Ansible controller. # automationedacontroller_controller_verify_ssl = true # # Certificate and key to install in Automation Event-Driven Ansible controller node # automationedacontroller_ssl_cert=/path/to/automationeda.crt # automationedacontroller_ssl_key=/path/to/automationeda.key
[automationcontroller]
controller.example.com
[automationhub]
automationhub.example.com
[automationedacontroller]
automationedacontroller.example.com
[automationgateway]
gateway.example.com
[database]
data.example.com
[all:vars]
admin_password='<password>'
redis_mode=standalone
pg_host='data.example.com'
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>'
# Automation hub configuration
automationhub_admin_password= <PASSWORD>
automationhub_pg_host='data.example.com'
automationhub_pg_port=5432
automationhub_pg_database='automationhub'
automationhub_pg_username='automationhub'
automationhub_pg_password=<PASSWORD>
automationhub_pg_sslmode='prefer'
# Automation Event-Driven Ansible controller configuration
automationedacontroller_admin_password='<eda-password>'
automationedacontroller_pg_host='data.example.com'
automationedacontroller_pg_port=5432
automationedacontroller_pg_database='automationedacontroller'
automationedacontroller_pg_username='automationedacontroller'
automationedacontroller_pg_password='<password>'
# Keystore file to install in SSO node
# sso_custom_keystore_file='/path/to/sso.jks'
# This install will deploy SSO with sso_use_https=True
# Keystore password is required for https enabled SSO
sso_keystore_password=''
# This 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
# Automation Gateway configuration
automationgateway_admin_password=''
automationgateway_pg_host=''
automationgateway_pg_port=5432
automationgateway_pg_database='automationgateway'
automationgateway_pg_username='automationgateway'
automationgateway_pg_password=''
automationgateway_pg_sslmode='prefer'
# The main automation gateway URL that clients will connect to (e.g. https://<load balancer host>).
# If not specified, the first node in the [automationgateway] group will be used when needed.
# automationgateway_main_url = ''
# Certificate and key to install in Automation Gateway
# automationgateway_ssl_cert=/path/to/automationgateway.cert
# automationgateway_ssl_key=/path/to/automationgateway.key
# 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
# Boolean flag used to verify Automation Controller's
# web certificates when making calls from Automation Event-Driven Ansible controller.
# automationedacontroller_controller_verify_ssl = true
#
# Certificate and key to install in Automation Event-Driven Ansible controller node
# automationedacontroller_ssl_cert=/path/to/automationeda.crt
# automationedacontroller_ssl_key=/path/to/automationeda.key
関連情報
これらのインベントリー変数の詳細は、Red Hat Ansible Automation Platform インストールガイド の Ansible Automation Hub 変数 を参照してください。
3.2.1.4. 高可用性 Automation Hub
次の例を使用して、インベントリーファイルを設定し、高可用性 Automation Hub をインストールします。このインベントリーファイルには、クラスター設定を備えた高可用性 Automation Hub が含まれています。
HA デプロイメントをさらに設定して、SELinux 上で Automation Hub の高可用性デプロイメント を有効にすることができます。
データベースホスト IP の指定
-
automation_pg_host
およびautomation_pg_port
インベントリー変数を使用して、データベースホストの IP アドレスを指定します。以下に例を示します。
automationhub_pg_host='192.0.2.10' automationhub_pg_port=5432
automationhub_pg_host='192.0.2.10'
automationhub_pg_port=5432
-
また、
automationhub_pg_host
インベントリー変数の値を使用して、[database] セクションでデータベースホストの IP アドレスを指定します。
[database] 192.0.2.10
[database]
192.0.2.10
クラスター設定のインスタンスのリスト表示
-
クラスター設定をインストールする場合、[automationhub] セクションの
localhost ansible_connection=local
は、全インスタンスのホスト名または IP アドレスに置き換えます。以下に例を示します。
[automationhub] automationhub1.testing.ansible.com ansible_user=cloud-user automationhub2.testing.ansible.com ansible_user=cloud-user automationhub3.testing.ansible.com ansible_user=cloud-user
[automationhub]
automationhub1.testing.ansible.com ansible_user=cloud-user
automationhub2.testing.ansible.com ansible_user=cloud-user
automationhub3.testing.ansible.com ansible_user=cloud-user
次のステップ
各 Private Automation Hub サーバーの /etc/pulp/settings.py
に、次のディレクティブが存在することを確認します。
USE_X_FORWARDED_PORT = True USE_X_FORWARDED_HOST = True
USE_X_FORWARDED_PORT = True
USE_X_FORWARDED_HOST = True
automationhub_main_url
を指定しないと、[automationhub] グループの最初のノードがデフォルトで使用されます。
3.2.1.5. SELinux 上での Automation Hub の高可用性 (HA) デプロイメントの有効化
インベントリーファイルを設定して、SELinux 上で Automation Hub の高可用性デプロイメントを有効化できます。/var/lib/pulp
および /var/lib/pulp/pulpcore_static
の 2 つのマウントポイントを作成し、それぞれに適切な SELinux コンテキストを割り当てる必要があります。
/var/lib/pulp
pulpcore_static のコンテキストを追加し、Ansible Automation Platform インストーラーを実行してから、/var/lib/pulp
のコンテキストを追加する必要があります。
前提条件
サーバーに NFS エクスポートを設定している。
注記NFS 共有は、外部サーバー上でホストされます。高可用性 Automation Hub デプロイメントの一部ではありません。
手順
/var/lib/pulp
にマウントポイントを作成します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow mkdir /var/lib/pulp/
$ mkdir /var/lib/pulp/
テキストエディターを使用して
/etc/fstab
を開き、次の値を追加します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow srv_rhel8:/data /var/lib/pulp nfs defaults,_netdev,nosharecache,context="system_u:object_r:var_lib_t:s0" 0 0 srv_rhel8:/data/pulpcore_static /var/lib/pulp/pulpcore_static nfs defaults,_netdev,nosharecache,context="system_u:object_r:httpd_sys_content_rw_t:s0" 0 0
srv_rhel8:/data /var/lib/pulp nfs defaults,_netdev,nosharecache,context="system_u:object_r:var_lib_t:s0" 0 0 srv_rhel8:/data/pulpcore_static /var/lib/pulp/pulpcore_static nfs defaults,_netdev,nosharecache,context="system_u:object_r:httpd_sys_content_rw_t:s0" 0 0
systemd マネージャー設定をリロードするコマンドを実行します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl daemon-reload
$ systemctl daemon-reload
/var/lib/pulp
のマウントコマンドを実行します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow mount /var/lib/pulp
$ mount /var/lib/pulp
/var/lib/pulp/pulpcore_static
にマウントポイントを作成します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow mkdir /var/lib/pulp/pulpcore_static
$ mkdir /var/lib/pulp/pulpcore_static
マウントコマンドを実行します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow mount -a
$ mount -a
マウントポイントを設定したら、Ansible Automation Platform インストーラーを実行します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow setup.sh -- -b --become-user root
$ setup.sh -- -b --become-user root
-
インストールが完了したら、
/var/lib/pulp/
マウントポイントをアンマウントします。
関連情報
- SELinux コンテキストリストは、SELinux Requirements on the Pulp Project documentation を参照してください。
- Pulp フォルダーの詳細は、ファイルシステムレイアウト を参照してください。
3.2.1.5.1. pulpcore.service の設定
インベントリーファイルを設定し、SELinux コンテキストを適用した後、Pulp サービスを設定する必要があります。
手順
2 つのマウントポイントを設定したら、Pulp サービスをシャットダウンして
pulpcore.service
を設定します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl stop pulpcore.service
$ systemctl stop pulpcore.service
systemctl
を使用してpulpcore.service
を編集します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl edit pulpcore.service
$ systemctl edit pulpcore.service
以下のエントリーを
pulpcore.service
に追加し、ネットワークを起動し、リモートマウントポイントをマウントすることで、Automation Hub サービスが起動するようにします。Copy to Clipboard Copied! Toggle word wrap Toggle overflow [Unit] After=network.target var-lib-pulp.mount
[Unit] After=network.target var-lib-pulp.mount
remote-fs.target
を有効にします。Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl enable remote-fs.target
$ systemctl enable remote-fs.target
システムを再起動します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl reboot
$ systemctl reboot
トラブルシューティング
pulpcore SELinux ポリシーのバグにより、etc/pulp/certs/
のトークン認証公開鍵/秘密鍵に適切な SELinux ラベルがなく、パルププロセスが失敗する可能性があります。これが発生した場合は、次のコマンドを実行して、適切なラベルを一時的に貼り付けます。
chcon system_u:object_r:pulpcore_etc_t:s0 /etc/pulp/certs/token_{private,public}_key.pem
$ chcon system_u:object_r:pulpcore_etc_t:s0 /etc/pulp/certs/token_{private,public}_key.pem
システムのラベルを変更するたびに、このコマンドを繰り返して適切な SELinux ラベルを再割り当てします。
3.2.1.5.2. SELinux コンテキストの適用
インベントリーファイルを設定したら、コンテキストを適用して、SELinux 上で Automation Hub の高可用性 (HA) デプロイメントを有効化する必要があります。
手順
Pulp サービスをシャットダウンします。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl stop pulpcore.service
$ systemctl stop pulpcore.service
/var/lib/pulp/pulpcore_static
をアンマウントします。Copy to Clipboard Copied! Toggle word wrap Toggle overflow umount /var/lib/pulp/pulpcore_static
$ umount /var/lib/pulp/pulpcore_static
/var/lib/pulp/
をアンマウントします。Copy to Clipboard Copied! Toggle word wrap Toggle overflow umount /var/lib/pulp/
$ umount /var/lib/pulp/
テキストエディターで
/etc/fstab
を開き、/var/lib/pulp
の既存値を以下に置き換えます。Copy to Clipboard Copied! Toggle word wrap Toggle overflow srv_rhel8:/data /var/lib/pulp nfs defaults,_netdev,nosharecache,context="system_u:object_r:pulpcore_var_lib_t:s0" 0 0
srv_rhel8:/data /var/lib/pulp nfs defaults,_netdev,nosharecache,context="system_u:object_r:pulpcore_var_lib_t:s0" 0 0
マウントコマンドを実行します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow mount -a
$ mount -a
3.2.1.6. Private Automation Hub でのコンテンツ署名の設定
Ansible Certified Content Collections に正常に署名して公開するには、署名する Private Automation Hub を設定する必要があります。
前提条件
- GnuPG キーペアがセキュアに設定され、組織で管理されている。
- 公開鍵と秘密鍵のペアに、Private Automation Hub でコンテンツ署名を設定するのに適切なアクセス権がある。
手順
ファイル名のみを受け入れる署名スクリプトを作成します。
注記このスクリプトは署名サービスとして機能し、
PULP_SIGNING_KEY_FINGERPRINT
環境変数で指定された鍵を使用して、そのファイルの ASCII アーマー形式のgpg
デタッチ署名を生成する必要があります。スクリプトは、次の形式で JSON 構造を出力します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow {"file": "filename", "signature": "filename.asc"}
{"file": "filename", "signature": "filename.asc"}
すべてのファイル名は、現在の作業ディレクトリー内の相対パスです。ファイル名は、デタッチ署名でも同じにする必要があります。
以下に例を示します。
次のスクリプトはコンテンツの署名を生成します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a detached signature Check the exit status
#!/usr/bin/env bash FILE_PATH=$1 SIGNATURE_PATH="$1.asc" ADMIN_ID="$PULP_SIGNING_KEY_FINGERPRINT" PASSWORD="password" # Create a detached signature gpg --quiet --batch --pinentry-mode loopback --yes --passphrase \ $PASSWORD --homedir ~/.gnupg/ --detach-sign --default-key $ADMIN_ID \ --armor --output $SIGNATURE_PATH $FILE_PATH # Check the exit status STATUS=$? if [ $STATUS -eq 0 ]; then echo {\"file\": \"$FILE_PATH\", \"signature\": \"$SIGNATURE_PATH\"} else exit $STATUS fi
署名を有効にして Private Automation Hub を Ansible Automation Platform クラスターにデプロイすると、新しい UI が追加されたことがコレクションに表示されます。
automationhub_*
で始まるオプションは、Ansible Automation Platform インストーラーのインベントリーファイルを確認してください。Copy to Clipboard Copied! Toggle word wrap Toggle overflow [all:vars] . . . automationhub_create_default_collection_signing_service = True automationhub_auto_sign_collections = True automationhub_require_content_approval = True automationhub_collection_signing_service_key = /abs/path/to/galaxy_signing_service.gpg automationhub_collection_signing_service_script = /abs/path/to/collection_signing.sh
[all:vars] . . . automationhub_create_default_collection_signing_service = True automationhub_auto_sign_collections = True automationhub_require_content_approval = True automationhub_collection_signing_service_key = /abs/path/to/galaxy_signing_service.gpg automationhub_collection_signing_service_script = /abs/path/to/collection_signing.sh
2 つの新しいキー (automationhub_auto_sign_collections および automationhub_require_content_approval) は、コレクションが Private Automation Hub にアップロードされた後に署名および承認される必要があることを示します。
3.2.1.7. Event-Driven Ansible Controller に安全なプラグイン変数を追加する
redhat.insights_eda
または同様のプラグインを使用して、Event-Driven Ansible Controller でルールブックアクティベーションを実行する場合は、Ansible Automation Platform のディレクトリーに安全なプラグイン変数を追加する必要があります。これにより、Event-Driven Ansible Controller とソースプラグイン間の接続が確保され、ポートマッピングが正しく表示されます。
手順
-
安全なプラグイン変数のディレクトリーを作成します:
mkdir -p ./group_vars/automationedacontroller
-
そのディレクトリー内に新しい設定用のファイルを作成します (例:
touch ./group_vars/automationedacontroller/custom.yml
) 変数
automatededacontroller_additional_settings
を追加して、Event-Driven Ansible Controller のデフォルトのsettings.yaml
テンプレートを拡張し、有効にするプラグインのリストを含むSAFE_PLUGINS
フィールドを追加します。以下に例を示します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow automationedacontroller_additional_settings: SAFE_PLUGINS: - ansible.eda.webhook - ansible.eda.alertmanager
automationedacontroller_additional_settings: SAFE_PLUGINS: - ansible.eda.webhook - ansible.eda.alertmanager
注記SAFE_PLUGINS
に加えて、Django 設定ファイル (/etc/ansible-automation-platform/eda/settings.yaml
) でautomationedacontroller_additional_settings
変数を拡張することもできます。
3.2.2. registry_username と registry_password の設定
オンラインの非バンドルインストールに registry_username
変数および registry_password
変数を使用する場合は、新しい Registry Service Account を作成する必要があります。
Registry Service Account は、デプロイメントシステムなど、認証情報が共有される環境で使用できる名前付きトークンです。
手順
- https://access.redhat.com/terms-based-registry/accounts に移動します。
- Registry Service Account ページで、 をクリックします。
- 許可される文字のみを使用して、アカウントの名前を入力します。
- 必要に応じて、アカウントの説明を入力します。
- をクリックします。
- 検索フィールドで名前を検索し、作成したアカウントをリストで確認します。
- 作成したアカウントの名前をクリックします。
または、トークンの名前がわかっている場合は、URL を入力してページに直接移動することもできます。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow https://access.redhat.com/terms-based-registry/token/<name-of-your-token>
https://access.redhat.com/terms-based-registry/token/<name-of-your-token>
token ページが開き、生成されたユーザー名 (アカウント名とは異なる) とトークンが表示されます。
トークンが表示されない場合は、
をクリックします。これをクリックして、新しいユーザー名とトークンを生成することもできます。-
ユーザー名 (例: "1234567|testuser") をコピーし、これを使用して変数
registry_username
を設定します。 -
トークンをコピーし、これを使用して変数
registry_password
を設定します。
3.2.2.1. Redis の設定
Ansible Automation Platform は、standalone
トポロジーと clustered
トポロジーの両方で、集中型の Redis インスタンスを提供します。
RPM デプロイメントでは、Redis モードがデフォルトで cluster
に設定されます。この設定は、次の例のように、インベントリーファイルの [all:vars]
セクションで変更できます。
[all:vars] admin_password='<password>' pg_host='data.example.com' 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>' redis_mode=cluster
[all:vars]
admin_password='<password>'
pg_host='data.example.com'
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>'
redis_mode=cluster
Redis の詳細は、インストール計画 の キャッシュおよびキューイングシステム を参照してください。