이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 6. Renewing and changing the SSL/TLS certificates
If your current SSL/TLS certificates have expired or will expire soon, you can either renew or replace the SSL/TLS certificates used by Ansible Automation Platform.
You must renew the SSL/TLS certificates if you need to regenerate them with new information such as new hosts.
You must replace the SSL/TLS certificates if you want to use certificates signed by an internal certificate authority.
6.1. Container-based installations 링크 복사링크가 클립보드에 복사되었습니다!
You can change the TLS certificates and keys for your container-based Ansible Automation Platform installation. This process involves a preparation step, either providing new custom certificates or deleting or moving the old certificates, followed by running the installation program.
6.1.1. Changing TLS certificates and keys using the installation program 링크 복사링크가 클립보드에 복사되었습니다!
The following procedure describes how to update the TLS certificates and keys by using the installation program.
Procedure
To prepare the certificates and keys, choose one of the following methods:
To provide custom certificates - For each service that requires updated TLS certificates, copy the new certificates and keys to a path relative to the Ansible Automation Platform installer. Then update the inventory file variables with the absolute paths to the new files.
# Platform gateway gateway_tls_cert=<path_to_tls_certificate> gateway_tls_key=<path_to_tls_key> gateway_pg_tls_cert=<path_to_tls_certificate> gateway_pg_tls_key=<path_to_tls_key> gateway_redis_tls_cert=<path_to_tls_certificate> gateway_redis_tls_key=<path_to_tls_key> # Automation controller controller_tls_cert=<path_to_tls_certificate> controller_tls_key=<path_to_tls_key> controller_pg_tls_cert=<path_to_tls_certificate> controller_pg_tls_key=<path_to_tls_key> # Automation hub hub_tls_cert=<path_to_tls_certificate> hub_tls_key=<path_to_tls_key> hub_pg_tls_cert=<path_to_tls_certificate> hub_pg_tls_key=<path_to_tls_key> # Event-Driven Ansible eda_tls_cert=<path_to_tls_certificate> eda_tls_key=<path_to_tls_key> eda_pg_tls_cert=<path_to_tls_certificate> eda_pg_tls_key=<path_to_tls_key> eda_redis_tls_cert=<path_to_tls_certificate> eda_redis_tls_key=<path_to_tls_key> # PostgreSQL postgresql_tls_cert=<path_to_tls_certificate> postgresql_tls_key=<path_to_tls_key> # Receptor receptor_tls_cert=<path_to_tls_certificate> receptor_tls_key=<path_to_tls_key>To generate new certificates - If you want the installation program to generate a new certificate for a service, delete or move the existing certificates and keys.
Table 6.1. Certificate and key file paths per service Service Certificate file path Key file path Automation controller
~/aap/controller/etc/tower.cert~/aap/controller/etc/tower.keyEvent-Driven Ansible
~/aap/eda/etc/eda.cert~/aap/eda/etc/eda.keyPlatform gateway
~/aap/gateway/etc/gateway.cert~/aap/gateway/etc/gateway.keyAutomation hub
~/aap/hub/etc/pulp.cert~/aap/hub/etc/pulp.keyPostgreSQL
~/aap/postgresql/server.crt~/aap/postgresql/server.keyReceptor
~/aap/receptor/etc/receptor.crt~/aap/receptor/etc/receptor.keyRedis
~/aap/redis/server.crt~/aap/redis/server.key
After preparing your certificates, run the
installplaybook from your installation directory:ansible-playbook -i <inventory_file_name> ansible.containerized_installer.install
Verification
Verify that the new TLS certificates are in use by checking that the services are running and accessible. To do this, check a specific endpoint by using curl:
$ curl -vk https://<hostname_or_ip>:<port_number>/api/v2/
The output of this command gives details about the TLS handshake. Look for the following output to confirm the correct certificate is being used:
* SSL certificate verify OK
6.2. Operator-based installations 링크 복사링크가 클립보드에 복사되었습니다!
The following procedure describes how to change the SSL/TLS certificate and key for automation controller running on OpenShift Container Platform.
Procedure
- Copy the signed SSL/TLS certificate and key to a secure location.
Create a TLS secret within OpenShift:
oc create secret tls ${CONTROLLER_INSTANCE}-certs-$(date +%F) --cert=/path/to/ssl.crt --key=/path/to/ssl.keyModify the automation controller custom resource to add
route_tls_secretand the name of the new secret to the spec section.oc edit automationcontroller/${CONTROLLER_INSTANCE}... spec: route_tls_secret: automation-controller-certs-2023-04-06 ...
The name of the TLS secret is arbitrary. In this example, it is timestamped with the date that the secret is created, to differentiate it from other TLS secrets applied to the automation controller instance.
- Wait a few minutes for the changes to be applied.
Verify that new SSL/TLS certificate and key have been installed:
true | openssl s_client -showcerts -connect ${CONTROLLER_FQDN}:443
The following procedure describes how to change the SSL/TLS certificate and key for automation hub running on OpenShift Container Platform.
Procedure
- Copy the signed SSL/TLS certificate and key to a secure location.
Create a TLS secret within OpenShift:
oc create secret tls ${AUTOMATION_HUB_INSTANCE}-certs-$(date +%F) --cert=/path/to/ssl.crt --key=/path/to/ssl.keyModify the automation hub custom resource to add
route_tls_secretand the name of the new secret to the spec section.oc edit automationhub/${AUTOMATION_HUB_INSTANCE}... spec: route_tls_secret: automation-hub-certs-2023-04-06 ...
The name of the TLS secret is arbitrary. In this example, it is timestamped with the date that the secret is created, to differentiate it from other TLS secrets applied to the automation hub instance.
- Wait a few minutes for the changes to be applied.
Verify that new SSL/TLS certificate and key have been installed:
true | openssl s_client -showcerts -connect ${CONTROLLER_FQDN}:443
6.3. RPM-based installations 링크 복사링크가 클립보드에 복사되었습니다!
To renew or change SSL/TLS certificates for RPM-based installations, you can edit the inventory file and run the installation program. The installation program verifies that all Ansible Automation Platform components are working.
Alternatively, you can change the SSL/TLS certificates manually. This is quicker, but there is no automatic verification.
Red Hat recommends that you use the installation program to make changes to your Ansible Automation Platform deployment.
6.3.1. Renewing the self-signed SSL/TLS certificates 링크 복사링크가 클립보드에 복사되었습니다!
The following steps regenerate new SSL/TLS certificates for all Ansible Automation Platform components.
Procedure
Add
aap_service_regen_cert=trueto the inventory file in the[all:vars]section:[all:vars] aap_service_regen_cert=true- Run the installation program.
Verification
Validate the CA file and certificate file on Event-Driven Ansible controller:
openssl verify -CAfile ansible-automation-platform-managed-ca-cert.crt /etc/ansible-automation-platform/eda/server.cert openssl s_client -connect <EDA_FQDN>:443Validate the CA file and certificate file on platform gateway:
openssl verify -CAfile ansible-automation-platform-managed-ca-cert.crt /etc/ansible-automation-platform/gateway/gateway.cert openssl s_client -connect <GATEWAY_FQDN>:443Validate the CA file and certificate file on automation hub:
openssl verify -CAfile ansible-automation-platform-managed-ca-cert.crt /etc/pulp/certs/pulp_webserver.crt openssl s_client -connect <HUB_FQDN>:443Validate the CA file and certificate file on automation controller:
openssl verify -CAfile ansible-automation-platform-managed-ca-cert.crt /etc/tower/tower.cert openssl s_client -connect <CONTROLLER_FQDN>:443
6.3.2. Changing SSL/TLS certificates and keys using the installation program 링크 복사링크가 클립보드에 복사되었습니다!
The following procedure describes how to change the SSL/TLS certificate and key in the inventory file.
Prerequisites
- The certificates must be in PEM format.
- If there is an intermediate certificate authority, you must append it to the server certificate.
- Use the correct order for the certificates: The server certificate comes first, followed by the intermediate certificate authority.
For further information, see the ssl certificate section of the NGINX documentation.
Procedure
- Copy the new SSL/TLS certificates and keys to a path relative to the Ansible Automation Platform installer.
Add the absolute paths of the SSL/TLS certificates and keys to the inventory file. Refer to Inventory file variables for guidance on setting these variables.
-
Event-Driven Ansible controller:
automationedacontroller_ssl_cert,automationedacontroller_ssl_key,custom_ca_cert -
Platform gateway:
automationgateway_ssl_cert,automationgateway_ssl_key,custom_ca_cert -
Automation hub:
automationhub_ssl_cert,automationhub_ssl_key,custom_ca_cert Automation controller:
web_server_ssl_cert,web_server_ssl_key,custom_ca_certNoteThe
custom_ca_certmust be the root certificate authority that signed the intermediate certificate authority. This file is installed in/etc/pki/ca-trust/source/anchors.
-
Event-Driven Ansible controller:
- Run the installation program.
6.3.3. Changing SSL/TLS certificates and keys manually 링크 복사링크가 클립보드에 복사되었습니다!
The following procedure describes how to change SSL/TLS certificates and keys manually for all Ansible Automation Platform components.
Procedure
Backup the current SSL/TLS certificate:
cp <CERT_PATH> <CERT_PATH>-$(date +%F)Backup the current key files:
cp <KEY_PATH> <KEY_PATH>-$(date +%F)- Copy the new SSL/TLS certificate to the certificate path.
- Copy the new key to the key path.
Restore the SELinux context:
restorecon -v <CERT_PATH> <KEY_PATH>Set appropriate permissions for the certificate and key files:
chown <OWNER>:<GROUP> <CERT_PATH> <KEY_PATH> chmod 0600 <CERT_PATH> <KEY_PATH>Test the NGINX configuration:
nginx -tReload NGINX:
systemctl reload nginx.serviceVerify that new SSL/TLS certificate and key have been installed:
true | openssl s_client -showcerts -connect <COMPONENT_FQDN>:443Table 6.2. SSL/TLS certificate and key file paths per service Service Certificate file path Key file path Owner:Group Automation controller
/etc/tower/tower.cert/etc/tower/tower.keyroot:awxAutomation hub
/etc/pulp/certs/pulp_webserver.crt/etc/pulp/certs/pulp_webserver.keyroot:pulpEvent-Driven Ansible controller
/etc/ansible-automation-platform/eda/server.cert/etc/ansible-automation-platform/eda/server.keyroot:edaPlatform gateway
/etc/ansible-automation-platform/gateway/gateway.cert/etc/ansible-automation-platform/gateway/gateway.keyroot:gateway