1.3. Automation Dashboard を Ansible Automation Platform に統合する


Ansible Automation Platform インスタンスを Automation Dashboard 設定に統合して、データを収集、視覚化し、自動化に関する洞察を得ます。

手順

  1. Red Hat Enterprise Linux ホストの https ポート 8447 で Automation Dashboard が実行されていることを確認します。

    注記
    • この検証には、Ansible Automation Platform のログインの詳細が必要です。
    • ポート 8447 はデフォルトで有効になっていますが、これは設定可能です。
  2. 次の情報を使用して、Ansible Automation Platform インスタンスを clusters.yaml に追加します。

    • フロントエンドアクセス用の Ansible Automation Platform の URL/ポート
    • read アクセス用に事前設定された Ansible Automation Platform OAuth アクセストークンとリフレッシュトークン。
    • OAuth2 クライアントクレデンシャル

      注記

      Ansible Automation Platform にアクセスできない場合は、管理者にお問い合わせください。

  3. Personal Access Token の設定詳細は、トークンベースの認証を使用した外部アプリケーションへのアクセスの設定 を参照してください。
  4. アクセストークンを設定したら、次のコマンドを実行します。

    cp clusters.example.yaml clusters.yaml
    vi clusters.yaml
    Copy to Clipboard Toggle word wrap
  5. 以下の方法を使用して、データのプルと結合のために、1 つ以上の Ansible Automation Platform インスタンス (同じ Ansible Automation Platform バージョン) を Automation Dashboard 設定に追加できます。

    注記

    Ansible Automation Platform インスタンスが 1 つしかない場合は、2 番目のエントリーを削除します。

    ---
    clusters:
      - protocol: https			<--- Normally https
        address: my-aap.example.com  <--- Can use IP or FQDN without http(s)://
        port: 443				<--- Normally 443
        access_token: sampleToken	<--- Your preconfigured Ansible Automation Platform read access token
      Platform read access token
        refresh_token: myRefreshToken
        client_id: myClientID
        client_secret: myClientSecret
        verify_ssl: false		<--- Can be used when using self signed certs
        sync_schedules:
          - name: Every 5 minutes sync
            rrule: DTSTART;TZID=Europe/Ljubljana:20250630T070000 FREQ=MINUTELY;INTERVAL=5
            enabled: true
    
      - protocol: https
        address: aap2.example.com
        port: 443
        access_token: WRn2swiqg5spEwUndDkrJoCeg4Qwuw
        verify_ssl: true
        sync_schedules:
          - name: Every 5 minutes sync
            rrule: DTSTART;TZID=Europe/Ljubljana:20250630T070000 FREQ=MINUTELY;INTERVAL=5
            enabled: true
    Copy to Clipboard Toggle word wrap
    注記

    access_tokenrefresh_token、および client_secret は Automation Dashboard データベースに保存されます。これらの値はセキュリティーのために暗号化されています。

  6. 次のコマンドを実行して、Automation Dashboard の設定を読み込んでアクティブ化します。

    podman cp clusters.yaml automation-dashboard-web:/
    podman exec automation-dashboard-web /venv/bin/python ./manage.py setclusters /clusters.yaml
    Copy to Clipboard Toggle word wrap
    注記

    Automation Dashboard は refresh_tokenclient_id、および client_secret を使用して、現在のトークンの期限が切れると、新しい access_token および refresh_token を自動的に取得します。このユーティリティーは、ping エンドポイントを使用して Ansible Automation Platform バージョンを検出し、正しいトークン更新エンドポイントを見つけます。

    podman exec automation-dashboard-web /venv/bin/python ./manage.py setclusters /clusters.yaml
    Check if table exists.
    Reading YML file.
    Adding cluster: address=my-aap.example.com
    
    INFO 2025-05-20 09:55:00,926 connector 187 140208297051968 Checking if is AAP 2.4 at https://my-aap.example.com:443
    INFO 2025-05-20 09:55:00,926 connector 187 140208297051968 Pinging api https://my-aap.example.com:443/api/v2/ping/
    INFO 2025-05-20 09:55:00,926 connector 187 140208297051968 Executing GET request to https://my-aap.example.com:443/api/v2/ping/
    
    ERROR 2025-05-20 09:55:00,032 connector 301 140025281152832 GET request failed with status 404
    Successfully set up AAP clusters
    Copy to Clipboard Toggle word wrap
    注記

    Automation Dashboard は、Ansible Automation Platform 2.4、2.5、および 2.6 インスタンスをチェックします。出力例に示されているように、これにより 404 エラーが発生する可能性があります。エラーの詳細は、この章の検証セクションを参照してください。

  7. 手動でデータを取得して Automation Dashboard の設定をテストするには、次のコマンドを使用します。

    podman exec -it automation-dashboard-web /venv/bin/python ./manage.py syncdata --since=2025-04-01 --until=2025-06-01
    Successfully created Sync task for Cluster https://my-aap.example.com:443.
    Copy to Clipboard Toggle word wrap
    注記

    テスト時間を短縮するには、日付間隔を短くすることを検討してください。形式は YYYY-MM-DD です。

    次に、journalctl を使用して進行状況を確認できます。

    sudo journalctl -fn10
    Copy to Clipboard Toggle word wrap
  8. ブラウザーを更新すると、Automation Dashboard 内で取得したデータが表示されます。

1.3.1. クラスターアクセストークンの確認

クラスターデータを設定してロードした後、デバッグの目的で保存されているアクセストークンを確認します。

手順

  1. --decrypt オプションを指定した getclusters 管理コマンドを使用して、保存されている access_tokenrefresh_token をプレーンテキストで表示します。
  2. automation-dashboard-web コンテナーで次のコマンドを実行します。

    podman exec -it automation-dashboard-web /venv/bin/python ./manage.py getclusters --decrypt
    Copy to Clipboard Toggle word wrap
  3. 出力を確認し、保存されたトークンが正しく、最新であることを確認します。

clusters:
  - protocol: https
    address: my-aap.example.com
    port: 443
    access_token: sampleToken
    refresh_token: myRefreshToken
    client_id: myClientID
    client_secret: myClientSecret
    verify_ssl: false
    sync_schedules:
      - name: Every 5 minutes sync
        rrule: DTSTART;TZID=Europe/Ljubljana:20250630T070000 FREQ=MINUTELY;INTERVAL=5
        enabled: true
Copy to Clipboard Toggle word wrap

注記

デバッグのために暗号化された access_tokenrefresh_token をプレーンテキストで表示するには、--decrypt フラグが必要です。このコマンドは、セキュアでないシステムでは使用しないでください。

./manage.py getclusters --decrypt によって生成された出力をファイル clusters.yaml に書き込み、それを ./manage.py setclusters clusters.yaml の入力として使用できます。

検証

インストール時にエラーメッセージが表示される場合は、次の表を参照してください。

Expand

問題

考えられる原因

ソリューション

401 エラー

これは、不正な認証情報やトークンなどの認証エラーを示す不正アクセスメッセージです。

clusters.yaml でアクセストークンが正しいことを確認します。

401 エラー

トークンの有効期限が切れ、すぐに更新を試行すると、一時的な 401 エラーが発生することが想定されます。

自動トークン更新が失敗した場合 (たとえば、client_secret または refresh_token が無効であるために)、getclusters --decrypt コマンドを使用して、データベースに保存されている認証情報がソース clusters.yaml ファイル内の認証情報と一致していることを手動で確認します。一致しない場合は、正しい設定で setclusters コマンドを再実行します。リフレッシュトークンは 1 回だけ使用できます。アクセストークンが無効であることが原因で setclusters を実行する必要がある場合は、新しいアクセストークンとリフレッシュトークンを作成し、ソース clusters.yaml で新しいトークンを使用します。

404 エラー

“not found” メッセージで、何かが正しく設定されていないか、正しいエンドポイントを指していないことを示しています。

clusters.yaml で使用される Ansible Automation Platform インスタンスの URL が正しいことを確認します。

インストールが成功すると、次の 3 つのコンテナーサービスが実行されるはずです。

podman ps --all --format "{{.Names}}"

postgresql
automation-dashboard-task
automation-dashboard-web
Copy to Clipboard Toggle word wrap

次のコマンドを実行すると、コンテナーのログを確認できます。

journalctl CONTAINER_NAME=container (where container equals one of postgresql automation-dashboard-task or automation-dashboard-web)

For example:
journalctl CONTAINER_NAME=automation-dashboard-task
May 22 13:02:07 automation-dashboard automation-dashboard-task[1607]: [wait-for-migrations-dashboard.sh] Waiting for database migrations...
May 22 13:02:07 automation-dashboard automation-dashboard-task[1607]: [wait-for-migrations-dashboard.sh] Attempt 1
May 22 13:02:10 automation-dashboard automation-dashboard-task[1607]: INFO 2025-05-22 13:02:10,636 periodic 2 140568371550016 Starting sync task.
May 22 13:02:10 automation-dashboard automation-dashboard-task[1607]: INFO 2025-05-22 13:02:10,636 periodic 2 140568371550016 Retrieving clusters inform>
May 22 13:02:10 automation-dashboard automation-dashboard-task[1607]: INFO 2025-05-22 13:02:10,747 periodic 2 140568371550016 Retrieved 1 clusters.
May 22 13:02:10 automation-dashboard automation-dashboard-task[1607]: INFO 2025-05-22 13:02:10,761 periodic 2 140568371550016 Retrieving data from clust>
May 22 13:02:10 automation-dashboard automation-dashboard-task[1607]: INFO 2025-05-22 13:02:10,761 connector 2 140568371550016 Checking Ansible Automation Platform version at h>
May 22 13:02:10 automation-dashboard automation-dashboard-task[1607]: INFO 2025-05-22 13:02:10,761 connector 2 140568371550016 Checking if is Ansible Automation Platform 2.5 at>
May 22 13:02:10 automation-dashboard automation-dashboard-task[1607]: INFO 2025-05-22 13:02:10,761 connector 2 140568371550016 Pinging api https://ec2-3>
May 22 13:02:10 automation-dashboard automation-dashboard-task[1607]: INFO 2025-05-22 13:02:10,761 connector 2 140568371550016 Executing GET request to >
May 22 13:02:13 automation-dashboard automation-dashboard-task[1607]: ERROR 2025-05-22 13:02:13,820 connector 2 140568371550016 GET request failed with >
May 22 13:02:13 automation-dashboard automation-dashboard-task[1607]: INFO 2025-05-22 13:02:13,821 connector 2 140568371550016 Checking if is Ansible Automation Platform 2.4 at>
May 22 13:02:13 automation-dashboard automation-dashboard-task[1607]: INFO 2025-05-22 13:02:13,821 connector 2 140568371550016 Pinging api https://ec2-3>
May 22 13:02:13 automation-dashboard automation-dashboard-task[1607]: INFO 2025-05-22 13:02:13,821 connector 2 140568371550016 Executing GET request to >
May 22 13:02:16 automation-dashboard automation-dashboard-task[1607]: ERROR 2025-05-22 13:02:16,892 connector 2 140568371550016 GET request failed with ...
Copy to Clipboard Toggle word wrap

以下のログスニペットは、トークンの更新が成功したことを示しています。

注記

このログスニペットでは、簡潔にするためにタイムスタンプとホスト名は省略されています。

journalctl CONTAINER_NAME=automation-dashboard-task
INFO Checking if is AAP 2.5 ... 2.6 at https://app.example.com:443
INFO Pinging api https://app.example.com:443/api/gateway/v1/ping/
INFO Detected AAP version AAP 2.6 at https://app.example.com:443
INFO Executing GET request to https://app.example.com:443/api/controller/v2/organizations/?page_size=100&page=1
ERROR GET request failed with status 401
INFO Token refresh POST request succedded with status 201
ERROR GET after reauth response.status_code=200
INFO Executing GET request to https://app.example.com:443/api/controller/v2/job_templates/?page_size=200&page=1
Executing GET request to https://app.example.com:443/api/controller/v2/jobs/?page_size=100&page=1&order_by=finished&finished__gt=2025-10-23T13:01:09.768681Z
Copy to Clipboard Toggle word wrap

systemd を使用してサービスがどのように実行されているかを確認します。

systemctl status --user

● automation-dashboard
    State: running
    Units: 76 loaded (incl. loaded aliases)
     Jobs: 0 queued
   Failed: 0 units
    Since: Thu 2025-05-22 13:02:07 UTC; 22min ago
  systemd: 252-51.el9
   CGroup: /user.slice/user-1000.slice/user@1000.service
           ├─app.slice
           │ ├─automation-dashboard-task.service
           │ │ └─1607 /usr/bin/conmon --api-version 1 -c 84e46532e8ca31b0cadb037479289d030103aa01b7a1591e62b83b17f031e47d -u 84e46532e8ca31b0cadb037479>
           │ ├─automation-dashboard-web.service
           │ │ └─1608 /usr/bin/conmon --api-version 1 -c d060f3e3fb2b4c4c5c588149253beed83c78ccc9c9a8c1bf4c96157142a210dc -u d060f3e3fb2b4c4c5c58814925>
           │ ├─dbus-broker.service
           │ │ ├─1621 /usr/bin/dbus-broker-launch --scope user
           │ │ └─1624 dbus-broker --log 4 --controller 9 --machine-id 612db98503014199bfd8c788c8d3da58 --max-bytes 100000000000000 --max-fds 2500000000>
           │ └─postgresql.service
           │   └─1614 /usr/bin/conmon --api-version 1 -c eec61745cb6fc3a89a4f7475d7ef63b5899699157d943c2f16a3243311927bef -u eec61745cb6fc3a89a4f7475d7>
           ├─init.scope
           │ ├─1093 /usr/lib/systemd/systemd --user
           │ └─1128 "(sd-pam)"
           └─user.slice
             ├─libpod-84e46532e8ca31b0cadb037479289d030103aa01b7a1591e62b83b17f031e47d.scope
             │ └─container
             │   ├─1619 /usr/bin/dumb-init -- /usr/bin/launch_dashboard_task.sh
             │   └─1681 /venv/bin/python periodic.py
             ├─libpod-d060f3e3fb2b4c4c5c588149253beed83c78ccc9c9a8c1bf4c96157142a210dc.scope
             │ └─container
             │   ├─1617 /usr/bin/dumb-init -- /usr/bin/launch_dashboard_web.sh
             │   ├─1646 /usr/bin/python3.9 /usr/local/bin/supervisord -c /etc/supervisord_dashboard_web.conf
             │   ├─1877 /bin/bash /usr/local/bin/stop-supervisor
             │   ├─1878 "nginx: master process nginx -g daemon off;"
             │   ├─1879 /venv/bin/uwsgi /etc/tower/uwsgi.ini
             │   ├─1880 "nginx: worker process"
             │   ├─1881 "nginx: worker process"
             │   ├─1882 "nginx: worker process"
             │   ├─1883 "nginx: worker process"
             │   ├─1884 /venv/bin/uwsgi /etc/tower/uwsgi.ini
             │   ├─1885 /venv/bin/uwsgi /etc/tower/uwsgi.ini
             │   ├─1886 /venv/bin/uwsgi /etc/tower/uwsgi.ini
             │   ├─1887 /venv/bin/uwsgi /etc/tower/uwsgi.ini
             │   └─1888 /venv/bin/uwsgi /etc/tower/uwsgi.ini
             ├─libpod-eec61745cb6fc3a89a4f7475d7ef63b5899699157d943c2f16a3243311927bef.scope
             │ └─container
             │   ├─1623 postgres
             │   ├─1869 "postgres: logger "
             │   ├─1871 "postgres: checkpointer "
             │   ├─1872 "postgres: background writer "
             │   ├─1873 "postgres: walwriter "
             │   ├─1874 "postgres: autovacuum launcher "
             │   ├─1875 "postgres: stats collector "
             │   ├─1876 "postgres: logical replication launcher "
             │   └─1889 "postgres: aapdashboard aapdashboard 172.31.28.99(39338) idle"
             └─podman-pause-b6c4e853.scope
               └─1359 catatonit -P
Copy to Clipboard Toggle word wrap
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat