Questo contenuto non è disponibile nella lingua selezionata.
Chapter 5. Installing Ansible Automation Platform Operator from the OpenShift Container Platform CLI
Use these instructions to install the Ansible Automation Platform Operator on Red Hat OpenShift Container Platform from the OpenShift Container Platform command-line interface (CLI) using the oc command.
5.1. Prerequisites Copia collegamentoCollegamento copiato negli appunti!
- Access to Red Hat OpenShift Container Platform using an account with operator installation permissions.
-
The OpenShift Container Platform CLI
occommand is installed on your local system. Refer to Installing the OpenShift CLI in the Red Hat OpenShift Container Platform product documentation for further information.
5.2. Subscribing a namespace to an operator using the OpenShift Container Platform CLI Copia collegamentoCollegamento copiato negli appunti!
Create a project for the operator
oc new-project ansible-automation-platform
oc new-project ansible-automation-platformCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Create a file called
sub.yaml. Add the following YAML code to the
sub.yamlfile.Copy to Clipboard Copied! Toggle word wrap Toggle overflow This file creates a
Subscriptionobject calledansible-automation-platformthat subscribes theansible-automation-platformnamespace to theansible-automation-platform-operatoroperator.It then creates an
AutomationControllerobject calledexamplein theansible-automation-platformnamespace.To change the Automation controller name from
example, edit the name field in thekind: AutomationControllersection ofsub.yamland replace<automation_controller_name>with the name you want to use:apiVersion: automationcontroller.ansible.com/v1beta1 kind: AutomationController metadata: name: <automation_controller_name> namespace: ansible-automation-platform
apiVersion: automationcontroller.ansible.com/v1beta1 kind: AutomationController metadata: name: <automation_controller_name> namespace: ansible-automation-platformCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
oc applycommand to create the objects specified in thesub.yamlfile:oc apply -f sub.yaml
oc apply -f sub.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
To verify that the namespace has been successfully subscribed to the ansible-automation-platform-operator operator, run the oc get subs command:
oc get subs -n ansible-automation-platform
$ oc get subs -n ansible-automation-platform
For further information about subscribing namespaces to operators, see Installing from OperatorHub using the CLI in the Red Hat OpenShift Container Platform Operators guide.
You can use the OpenShift Container Platform CLI to fetch the web address and the password of the Automation controller that you created.
5.3. Fetching Automation controller login details from the OpenShift Container Platform CLI Copia collegamentoCollegamento copiato negli appunti!
To login to the Automation controller, you need the web address and the password.
5.3.1. Fetching the automation controller web address Copia collegamentoCollegamento copiato negli appunti!
A Red Hat OpenShift Container Platform route exposes a service at a host name, so that external clients can reach it by name. When you created the automation controller instance, a route was created for it. The route inherits the name that you assigned to the automation controller object in the YAML file.
Use the following command to fetch the routes:
oc get routes -n <controller_namespace>
oc get routes -n <controller_namespace>
In the following example, the example automation controller is running in the ansible-automation-platform namespace.
oc get routes -n ansible-automation-platform
$ oc get routes -n ansible-automation-platform
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
example example-ansible-automation-platform.apps-crc.testing example-service http edge/Redirect None
The address for the automation controller instance is example-ansible-automation-platform.apps-crc.testing.
5.3.2. Fetching the automation controller password Copia collegamentoCollegamento copiato negli appunti!
The YAML block for the automation controller instance in sub.yaml assigns values to the name and admin_user keys. Use these values in the following command to fetch the password for the automation controller instance.
oc get secret/<controller_name>-<admin_user>-password -o yaml
oc get secret/<controller_name>-<admin_user>-password -o yaml
The default value for admin_user is admin. Modify the command if you changed the admin username in sub.yaml.
The following example retrieves the password for an automation controller object called example:
oc get secret/example-admin-password -o yaml
oc get secret/example-admin-password -o yaml
The password for the automation controller instance is listed in the metadata field in the output:
For this example, the password is 88TG88TG88TG88TG88TG88TG88TG88TG.