5.3. OpenShift Container Platform CLI からの Automation Controller ログインの詳細の取得
Automation Controller にログインするには、Web アドレスとパスワードが必要です。
5.3.1. Automation Controller の Web アドレスの取得
Red Hat OpenShift Container Platform ルートは、外部クライアントが名前でサービスに到達できるように、ホスト名でサービスを公開します。Automation Controller インスタンスを作成した時に、そのルートが作成されました。ルートは、YAML ファイルで Automation Controller オブジェクトに割り当てた名前を継承します。
以下のコマンドを使用してルートを取得します。
oc get routes -n <controller_namespace>
oc get routes -n <controller_namespace>
Copy to clipboardCopied
以下の例では、Automation Controller の example
は 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
Copy to clipboardCopied
Automation Controller インスタンスのアドレスは、example-ansible-automation-platform.apps-crc.testing
です。
5.3.2. Automation Controller のパスワードの取得
sub.yaml
の Automation Controller インスタンスの YAML ブロックは、name および admin_user キーに値を割り当てます。以下のコマンドのこれらの値を使用して、Automation Controller インスタンスのパスワードを取得します。
oc get secret/<controller_name>-<admin_user>-password -o yaml
oc get secret/<controller_name>-<admin_user>-password -o yaml
Copy to clipboardCopied
admin_user のデフォルト値は admin
です。sub.yaml
で admin ユーザー名を変更した場合は、コマンドを変更します。
以下の例では、example
という名前の Automation Controller オブジェクトのパスワードを取得します。
oc get secret/example-admin-password -o yaml
oc get secret/example-admin-password -o yaml
Copy to clipboardCopied
Automation Controller インスタンスのパスワードは、出力の metadata
フィールドに表示されます。
oc get secret/example-admin-password -o yaml
$ oc get secret/example-admin-password -o yaml
apiVersion: v1
data:
password: ODzLODzLODzLODzLODzLODzLODzLODzLODzLODzLODzL
kind: Secret
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: '{"apiVersion":"v1","kind":"Secret","metadata":{"labels":{"app.kubernetes.io/component":"automationcontroller","app.kubernetes.io/managed-by":"automationcontroller-operator","app.kubernetes.io/name":"example","app.kubernetes.io/operator-version":"","app.kubernetes.io/part-of":"example"},"name":"example-admin-password","namespace":"ansible-automation-platform"},"stringData":{"password":"88TG88TG88TG88TG88TG88TG88TG88TG"}}'
creationTimestamp: "2021-11-03T00:02:24Z"
labels:
app.kubernetes.io/component: automationcontroller
app.kubernetes.io/managed-by: automationcontroller-operator
app.kubernetes.io/name: example
app.kubernetes.io/operator-version: ""
app.kubernetes.io/part-of: example
name: example-admin-password
namespace: ansible-automation-platform
resourceVersion: "185185"
uid: 39393939-5252-4242-b929-665f665f665f
Copy to clipboardCopied
この例では、パスワードは 88TG88TG88TG88TG88TG88TG88TG88TG
です。