はじめに
Ansible Automation Platform (AAP) コンテナ環境での AAPサービス(Pod)の停止・起動動作を確認しました
AAP 2.6 導入は下記をご参考ください。
実行環境
S1122 RHEL 9.6 (ppc64le) (PowerVS 提供イメージを使用)
# LD_SHOW_AUXV=1 /bin/true | grep _PLATFORM
AT_PLATFORM: power11
AT_BASE_PLATFORM: power11
# cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="9.6 (Plow)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="9.6"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Red Hat Enterprise Linux 9.6 (Plow)"
ANSI_COLOR="0;31"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:redhat:enterprise_linux:9::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9"
BUG_REPORT_URL="https://issues.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 9"
REDHAT_BUGZILLA_PRODUCT_VERSION=9.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.6"
リソース: 1 CPU, 32GB Memory
1 node 構成 (単体ノードにAAPを導入)
自動起動設定の確認
マニュアルの起動停止は以下の記載がありました。コンテナ環境はPodを操作するとあります。
コンテナー内で Automation Controller を実行する場合は、automation-controller-service スクリプトを使用しないでください。代わりに、コンテナー環境を使用して Pod を再起動します。
なお、AAPを導入した node 上には automation-controller-service スクリプトは存在していませんでした。
$ which automation-controller-service
/usr/bin/which: no automation-controller-service in (/home/ansible/.local/bin:/home/ansible/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin)
一般的に、RHEL の設定では、ユーザーが作成したコンテナの起動は systemd を使用して Podの自動起動を設定します。
AAP 2.6 では、/home/<install user>/.config/systemd/user 下で AAP のコンテナのsystemd 設定が存在していました。
install user は今回の環境では ansible というユーザーで実行していたため、下記のフォルダで設定が作成されています。
$ ls -l /home/ansible/.config/systemd/user
total 92
-rw-r--r-- 1 ansible ansible 860 Oct 11 00:31 automation-controller-rsyslog.service
-rw-r--r-- 1 ansible ansible 845 Oct 11 00:31 automation-controller-task.service
-rw-r--r-- 1 ansible ansible 840 Oct 11 00:31 automation-controller-web.service
-rw-r--r-- 1 ansible ansible 885 Oct 11 00:40 automation-eda-activation-worker-1.service
-rw-r--r-- 1 ansible ansible 885 Oct 11 00:40 automation-eda-activation-worker-2.service
-rw-r--r-- 1 ansible ansible 809 Oct 11 00:39 automation-eda-api.service
-rw-r--r-- 1 ansible ansible 824 Oct 11 00:39 automation-eda-daphne.service
-rw-r--r-- 1 ansible ansible 835 Oct 11 00:40 automation-eda-scheduler.service
-rw-r--r-- 1 ansible ansible 733 Oct 11 00:40 automation-eda-web.service
-rw-r--r-- 1 ansible ansible 830 Oct 11 00:40 automation-eda-worker-1.service
-rw-r--r-- 1 ansible ansible 830 Oct 11 00:40 automation-eda-worker-2.service
-rw-r--r-- 1 ansible ansible 763 Oct 11 00:20 automation-gateway-proxy.service
-rw-r--r-- 1 ansible ansible 733 Oct 11 00:23 automation-gateway.service
-rw-r--r-- 1 ansible ansible 809 Oct 11 00:45 automation-hub-api.service
-rw-r--r-- 1 ansible ansible 829 Oct 11 00:45 automation-hub-content.service
-rw-r--r-- 1 ansible ansible 733 Oct 11 00:46 automation-hub-web.service
-rw-r--r-- 1 ansible ansible 834 Oct 11 00:46 automation-hub-worker-1.service
-rw-r--r-- 1 ansible ansible 834 Oct 11 00:46 automation-hub-worker-2.service
drwxr-xr-x 2 ansible ansible 4096 Oct 11 00:47 default.target.wants
drwxrwx--- 2 ansible ansible 27 Oct 11 00:10 podman.service.d
-rw-r--r-- 1 ansible ansible 693 Oct 11 00:17 postgresql.service
-rw-r--r-- 1 ansible ansible 683 Oct 11 00:26 receptor.service
-rw-r--r-- 1 ansible ansible 688 Oct 11 00:19 redis-tcp.service
-rw-r--r-- 1 ansible ansible 693 Oct 11 00:19 redis-unix.service
drwxr-xr-x 2 ansible ansible 27 Oct 11 00:10 sockets.target.wants
[ansible@aap26 user]$ ls -l /home/ansible/.config/systemd/user^C
[ansible@aap26 user]$ ls -lR /home/ansible/.config/systemd/user
/home/ansible/.config/systemd/user:
total 92
-rw-r--r-- 1 ansible ansible 860 Oct 11 00:31 automation-controller-rsyslog.service
-rw-r--r-- 1 ansible ansible 845 Oct 11 00:31 automation-controller-task.service
-rw-r--r-- 1 ansible ansible 840 Oct 11 00:31 automation-controller-web.service
-rw-r--r-- 1 ansible ansible 885 Oct 11 00:40 automation-eda-activation-worker-1.service
-rw-r--r-- 1 ansible ansible 885 Oct 11 00:40 automation-eda-activation-worker-2.service
-rw-r--r-- 1 ansible ansible 809 Oct 11 00:39 automation-eda-api.service
-rw-r--r-- 1 ansible ansible 824 Oct 11 00:39 automation-eda-daphne.service
-rw-r--r-- 1 ansible ansible 835 Oct 11 00:40 automation-eda-scheduler.service
-rw-r--r-- 1 ansible ansible 733 Oct 11 00:40 automation-eda-web.service
-rw-r--r-- 1 ansible ansible 830 Oct 11 00:40 automation-eda-worker-1.service
-rw-r--r-- 1 ansible ansible 830 Oct 11 00:40 automation-eda-worker-2.service
-rw-r--r-- 1 ansible ansible 763 Oct 11 00:20 automation-gateway-proxy.service
-rw-r--r-- 1 ansible ansible 733 Oct 11 00:23 automation-gateway.service
-rw-r--r-- 1 ansible ansible 809 Oct 11 00:45 automation-hub-api.service
-rw-r--r-- 1 ansible ansible 829 Oct 11 00:45 automation-hub-content.service
-rw-r--r-- 1 ansible ansible 733 Oct 11 00:46 automation-hub-web.service
-rw-r--r-- 1 ansible ansible 834 Oct 11 00:46 automation-hub-worker-1.service
-rw-r--r-- 1 ansible ansible 834 Oct 11 00:46 automation-hub-worker-2.service
drwxr-xr-x 2 ansible ansible 4096 Oct 11 00:47 default.target.wants
drwxrwx--- 2 ansible ansible 27 Oct 11 00:10 podman.service.d
-rw-r--r-- 1 ansible ansible 693 Oct 11 00:17 postgresql.service
-rw-r--r-- 1 ansible ansible 683 Oct 11 00:26 receptor.service
-rw-r--r-- 1 ansible ansible 688 Oct 11 00:19 redis-tcp.service
-rw-r--r-- 1 ansible ansible 693 Oct 11 00:19 redis-unix.service
drwxr-xr-x 2 ansible ansible 27 Oct 11 00:10 sockets.target.wants
/home/ansible/.config/systemd/user/default.target.wants:
total 0
lrwxrwxrwx 1 ansible ansible 72 Oct 11 00:34 automation-controller-rsyslog.service -> /home/ansible/.config/systemd/user/automation-controller-rsyslog.service
lrwxrwxrwx 1 ansible ansible 69 Oct 11 00:34 automation-controller-task.service -> /home/ansible/.config/systemd/user/automation-controller-task.service
lrwxrwxrwx 1 ansible ansible 68 Oct 11 00:34 automation-controller-web.service -> /home/ansible/.config/systemd/user/automation-controller-web.service
lrwxrwxrwx 1 ansible ansible 77 Oct 11 00:40 automation-eda-activation-worker-1.service -> /home/ansible/.config/systemd/user/automation-eda-activation-worker-1.service
lrwxrwxrwx 1 ansible ansible 77 Oct 11 00:40 automation-eda-activation-worker-2.service -> /home/ansible/.config/systemd/user/automation-eda-activation-worker-2.service
lrwxrwxrwx 1 ansible ansible 61 Oct 11 00:40 automation-eda-api.service -> /home/ansible/.config/systemd/user/automation-eda-api.service
lrwxrwxrwx 1 ansible ansible 64 Oct 11 00:40 automation-eda-daphne.service -> /home/ansible/.config/systemd/user/automation-eda-daphne.service
lrwxrwxrwx 1 ansible ansible 67 Oct 11 00:40 automation-eda-scheduler.service -> /home/ansible/.config/systemd/user/automation-eda-scheduler.service
lrwxrwxrwx 1 ansible ansible 61 Oct 11 00:40 automation-eda-web.service -> /home/ansible/.config/systemd/user/automation-eda-web.service
lrwxrwxrwx 1 ansible ansible 66 Oct 11 00:40 automation-eda-worker-1.service -> /home/ansible/.config/systemd/user/automation-eda-worker-1.service
lrwxrwxrwx 1 ansible ansible 66 Oct 11 00:40 automation-eda-worker-2.service -> /home/ansible/.config/systemd/user/automation-eda-worker-2.service
lrwxrwxrwx 1 ansible ansible 67 Oct 11 00:23 automation-gateway-proxy.service -> /home/ansible/.config/systemd/user/automation-gateway-proxy.service
lrwxrwxrwx 1 ansible ansible 61 Oct 11 00:23 automation-gateway.service -> /home/ansible/.config/systemd/user/automation-gateway.service
lrwxrwxrwx 1 ansible ansible 61 Oct 11 00:47 automation-hub-api.service -> /home/ansible/.config/systemd/user/automation-hub-api.service
lrwxrwxrwx 1 ansible ansible 65 Oct 11 00:47 automation-hub-content.service -> /home/ansible/.config/systemd/user/automation-hub-content.service
lrwxrwxrwx 1 ansible ansible 61 Oct 11 00:47 automation-hub-web.service -> /home/ansible/.config/systemd/user/automation-hub-web.service
lrwxrwxrwx 1 ansible ansible 66 Oct 11 00:47 automation-hub-worker-1.service -> /home/ansible/.config/systemd/user/automation-hub-worker-1.service
lrwxrwxrwx 1 ansible ansible 66 Oct 11 00:47 automation-hub-worker-2.service -> /home/ansible/.config/systemd/user/automation-hub-worker-2.service
lrwxrwxrwx 1 ansible ansible 53 Oct 11 00:17 postgresql.service -> /home/ansible/.config/systemd/user/postgresql.service
lrwxrwxrwx 1 ansible ansible 51 Oct 11 00:26 receptor.service -> /home/ansible/.config/systemd/user/receptor.service
lrwxrwxrwx 1 ansible ansible 52 Oct 11 00:19 redis-tcp.service -> /home/ansible/.config/systemd/user/redis-tcp.service
lrwxrwxrwx 1 ansible ansible 53 Oct 11 00:19 redis-unix.service -> /home/ansible/.config/systemd/user/redis-unix.service
/home/ansible/.config/systemd/user/podman.service.d:
total 4
-rw-r--r-- 1 ansible ansible 88 Oct 11 00:10 override.conf
/home/ansible/.config/systemd/user/sockets.target.wants:
total 0
lrwxrwxrwx 1 ansible ansible 35 Oct 11 00:10 podman.socket -> /usr/lib/systemd/user/podman.socket
unitファイルの中身を1つ確認します。
例:/home/ansible/.config/systemd/user/automation-controller-web.service
$ cat /home/ansible/.config/systemd/user/automation-controller-web.service
# automation-controller-web.service
# autogenerated by Podman 5.4.0
# Sat Oct 11 00:31:54 EDT 2025
[Unit]
Description=Podman automation-controller-web.service
Documentation=man:podman-generate-systemd(1)
Wants=network-online.target
After=network-online.target
RequiresMountsFor=/run/user/1001/containers
# User-defined dependencies
Requires=postgresql.service redis-unix.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=always
TimeoutStopSec=90
ExecStart=/usr/bin/podman start automation-controller-web
ExecStop=/usr/bin/podman stop \
-t 30 automation-controller-web
ExecStopPost=/usr/bin/podman stop \
-t 30 automation-controller-web
PIDFile=/run/user/1001/containers/overlay-containers/eca157dbf3df1c2afadd40169bc934d216f996e8a44d35732e97f305666acea6/userdata/conmon.pid
Type=forking
[Install]
WantedBy=default.target
- [Unit]セクションの説明
| セクション | 項目 | 説明 |
|---|---|---|
[Unit] |
Description |
ユニットの説明。Podman によって生成された Automation Controller Web のサービス。 |
Documentation |
関連マニュアルへのリンク(podman-generate-systemd(1))。 |
|
Wants=network-online.target |
ネットワークがオンラインになることを希望(依存度は弱い)。 | |
After=network-online.target |
ネットワークがオンラインになった後に起動。 | |
RequiresMountsFor=/run/user/1001/containers |
コンテナのランタイムディレクトリがマウントされている必要がある。 | |
Requires=postgresql.service redis-unix.service |
PostgreSQL と Redis が起動している必要がある(強い依存関係)。 |
- [Service] セクションの説明
| セクション | 項目 | 説明 |
|---|---|---|
[Service] |
Environment=PODMAN_SYSTEMD_UNIT=%n |
systemd ユニット名(%n)を環境変数として Podman に渡す。Podman が systemd 経由で起動されたことを示す。 |
Restart=always |
サービスが異常終了した場合でも常に再起動されるように設定。 | |
TimeoutStopSec=90 |
サービス停止時に最大 90 秒間待機する。 | |
ExecStart=/usr/bin/podman start automation-controller-web |
指定された Podman コンテナ(automation-controller-web)を起動するコマンド。 |
|
ExecStop=/usr/bin/podman stop -t 30 automation-controller-web |
コンテナを停止するコマンド。-t 30 は 30 秒のタイムアウトを指定。 |
|
ExecStopPost=/usr/bin/podman stop -t 30 automation-controller-web |
停止後に再度停止コマンドを実行。停止処理の冗長性を確保するための設定。 | |
PIDFile=/run/user/1001/containers/.../conmon.pid |
コンテナのプロセス ID を記録するファイル。systemd がプロセスの状態を追跡するために使用。 | |
Type=forking |
ExecStart がフォークしてバックグラウンドで動作することを示す。Podman の起動方式に合わせた指定。 |
- [Install]セクションの説明
| セクション | 項目 | 説明 |
|---|---|---|
[Install] |
WantedBy=default.target |
このユニットがユーザーモード systemd の default.target に紐づけられていることを示す。systemctl --user enable によって有効化すれば、ユーザーのログイン時に自動起動される。 |
この設定があるため、OS停止・起動時に Pod が自動停止起動します。
AAP サービス/Pod の停止起動確認
ansible ユーザー(AAPインストール・ユーザー) で起動しているサービスを確認します。
$ whoami
ansible
$ systemctl --user list-units --type=service -all
UNIT LOAD ACTIVE SUB DESCRIPTION
automation-controller-rsyslog.service loaded active running Podman automation-controller-rsyslog.service
automation-controller-task.service loaded active running Podman automation-controller-task.service
automation-controller-web.service loaded active running Podman automation-controller-web.service
automation-eda-activation-worker-1.service loaded active running Podman automation-eda-activation-worker-1.service
automation-eda-activation-worker-2.service loaded active running Podman automation-eda-activation-worker-2.service
automation-eda-api.service loaded active running Podman automation-eda-api.service
automation-eda-daphne.service loaded active running Podman automation-eda-daphne.service
automation-eda-scheduler.service loaded active running Podman automation-eda-scheduler.service
automation-eda-web.service loaded active running Podman automation-eda-web.service
automation-eda-worker-1.service loaded active running Podman automation-eda-worker-1.service
automation-eda-worker-2.service loaded active running Podman automation-eda-worker-2.service
automation-gateway-proxy.service loaded active running Podman automation-gateway-proxy.service
automation-gateway.service loaded active running Podman automation-gateway.service
automation-hub-api.service loaded active running Podman automation-hub-api.service
automation-hub-content.service loaded active running Podman automation-hub-content.service
automation-hub-web.service loaded active running Podman automation-hub-web.service
automation-hub-worker-1.service loaded active running Podman automation-hub-worker-1.service
automation-hub-worker-2.service loaded active running Podman automation-hub-worker-2.service
dbus-broker.service loaded active running D-Bus User Message Bus
grub-boot-success.service loaded inactive dead Mark boot as successful
podman.service loaded inactive dead Podman API Service
postgresql.service loaded active running Podman postgresql.service
receptor.service loaded active running Podman receptor.service
redis-tcp.service loaded active running Podman redis-tcp.service
redis-unix.service loaded active running Podman redis-unix.service
systemd-tmpfiles-clean.service loaded inactive dead Cleanup of User's Temporary Files and Directories
systemd-tmpfiles-setup.service loaded active exited Create User's Volatile Files and Directories
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
27 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
24 個のサービスが Active で稼働中です。
ansible ユーザーでAAP以外のサービスは特に作成していないため、全て AAP インストール時に作成されたものが大半と思われますが、確認の結果、systemd-tmpfiles-*、dbus-broker.service、grub-boot-success.service(inactive)、podman.service(inactive) は AAP のサービスではなく、OS由来のサービスと考えられます。
上記を踏まえて、対象の サービスをスクリプトで一括停止します。
- 事前確認
存在している サービス数は27個でした。
$ systemctl --user list-units --type=service -all| grep .service | wc -l
27
以下はサービスのリストです。
$ systemctl --user list-units --type=service -all| grep .service
automation-controller-rsyslog.service loaded active running Podman automation-controller-rsyslog.service
automation-controller-task.service loaded active running Podman automation-controller-task.service
automation-controller-web.service loaded active running Podman automation-controller-web.service
automation-eda-activation-worker-1.service loaded active running Podman automation-eda-activation-worker-1.service
automation-eda-activation-worker-2.service loaded active running Podman automation-eda-activation-worker-2.service
automation-eda-api.service loaded active running Podman automation-eda-api.service
automation-eda-daphne.service loaded active running Podman automation-eda-daphne.service
automation-eda-scheduler.service loaded active running Podman automation-eda-scheduler.service
automation-eda-web.service loaded active running Podman automation-eda-web.service
automation-eda-worker-1.service loaded active running Podman automation-eda-worker-1.service
automation-eda-worker-2.service loaded active running Podman automation-eda-worker-2.service
automation-gateway-proxy.service loaded active running Podman automation-gateway-proxy.service
automation-gateway.service loaded active running Podman automation-gateway.service
automation-hub-api.service loaded active running Podman automation-hub-api.service
automation-hub-content.service loaded active running Podman automation-hub-content.service
automation-hub-web.service loaded active running Podman automation-hub-web.service
automation-hub-worker-1.service loaded active running Podman automation-hub-worker-1.service
automation-hub-worker-2.service loaded active running Podman automation-hub-worker-2.service
dbus-broker.service loaded active running D-Bus User Message Bus
grub-boot-success.service loaded inactive dead Mark boot as successful
podman.service loaded inactive dead Podman API Service
postgresql.service loaded active running Podman postgresql.service
receptor.service loaded active running Podman receptor.service
redis-tcp.service loaded active running Podman redis-tcp.service
redis-unix.service loaded active running Podman redis-unix.service
systemd-tmpfiles-clean.service loaded inactive dead Cleanup of User's Temporary Files and Directories
systemd-tmpfiles-setup.service loaded active exited Create User's Volatile Files and Directories
そのうち active なサービスは24個でした。
$ systemctl --user list-units --type=service -all| grep .service | grep -v inactive | wc -l
24
24 個の内、AAP 関連サービスのみ停止します。
- 起動中の Podを確認すると、22 個でした。
$ podman ps | grep -v IMAGE | wc -l
22
対象の pod リストです。 (上記のコマンドで数を数える際には1 行目を除外しています)
$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
406917282ad9 registry.redhat.io/rhel9/postgresql-15:latest run-postgresql 13 days ago Up 4 minutes 5432/tcp postgresql
9c100dbb22d2 registry.redhat.io/rhel9/redis-6:latest run-redis 13 days ago Up 4 minutes 6379/tcp redis-unix
2c922a73508a registry.redhat.io/rhel9/redis-6:latest run-redis 13 days ago Up 4 minutes 6379/tcp redis-tcp
eb0aea41522d registry.redhat.io/ansible-automation-platform-26/gateway-proxy-rhel9:latest /usr/bin/envoy --... 13 days ago Up 4 minutes automation-gateway-proxy
198c5e26c451 registry.redhat.io/ansible-automation-platform-26/gateway-rhel9:latest /usr/bin/supervis... 13 days ago Up 4 minutes automation-gateway
f836ba64c6ee registry.redhat.io/ansible-automation-platform-26/receptor-rhel9:latest /usr/bin/receptor... 13 days ago Up 18 minutes receptor
16b767c3b7fa registry.redhat.io/ansible-automation-platform-26/controller-rhel9:latest /usr/bin/launch_a... 13 days ago Up 4 minutes 8052/tcp automation-controller-rsyslog
83b0221b9349 registry.redhat.io/ansible-automation-platform-26/controller-rhel9:latest /usr/bin/launch_a... 13 days ago Up 4 minutes 8052/tcp automation-controller-task
eca157dbf3df registry.redhat.io/ansible-automation-platform-26/controller-rhel9:latest /usr/bin/launch_a... 13 days ago Up 4 minutes 8052/tcp automation-controller-web
23457b2df66f registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9:latest gunicorn --bind 1... 13 days ago Up 4 minutes automation-eda-api
8b205c3b0892 registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9:latest daphne --bind 127... 13 days ago Up 4 minutes automation-eda-daphne
e3835a586746 registry.redhat.io/ansible-automation-platform-26/eda-controller-ui-rhel9:latest /bin/sh -c nginx ... 13 days ago Up 4 minutes 8080/tcp, 8443/tcp automation-eda-web
0428037951ef registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9:latest aap-eda-manage rq... 13 days ago Up 4 minutes automation-eda-worker-1
7c1db45e1043 registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9:latest aap-eda-manage rq... 13 days ago Up 4 minutes automation-eda-worker-2
c58018563af8 registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9:latest aap-eda-manage rq... 13 days ago Up 4 minutes automation-eda-activation-worker-1
6788768f522e registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9:latest aap-eda-manage rq... 13 days ago Up 4 minutes automation-eda-activation-worker-2
c70264aeaa43 registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9:latest aap-eda-manage sc... 13 days ago Up 4 minutes automation-eda-scheduler
b2d6ac1e429b registry.redhat.io/ansible-automation-platform-26/hub-rhel9:latest pulpcore-api --na... 13 days ago Up 4 minutes automation-hub-api
b92262d7a499 registry.redhat.io/ansible-automation-platform-26/hub-rhel9:latest pulpcore-content ... 13 days ago Up 4 minutes automation-hub-content
d52cde0d311e registry.redhat.io/ansible-automation-platform-26/hub-web-rhel9:latest /bin/sh -c nginx ... 13 days ago Up 4 minutes 8080/tcp, 8443/tcp automation-hub-web
923e9b40d452 registry.redhat.io/ansible-automation-platform-26/hub-rhel9:latest pulpcore-worker 13 days ago Up 4 minutes automation-hub-worker-1
52c2ba3ea2de registry.redhat.io/ansible-automation-platform-26/hub-rhel9:latest pulpcore-worker 13 days ago Up 4 minutes automation-hub-worker-2
サービス停止実行
スクリプトで AAPの対象サービス停止を実行しています。
$ for svc in $(systemctl --user list-units --type=service --all | grep .service | grep -Ev 'systemd-tmpfiles|dbus-broker|podman.service|grub-boot-success.service' | awk '{print $1}'); do
> systemctl --user stop "$svc"
> done
$ echo $?
0
- Pod の稼働確認
全て停止しています。
$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$
サービスは receptor.service が failed となっていました。
これを除いて停止をした場合は、receptor の pod が稼働していました。
一応、failed ではありますが、pod は停止状態です。ただし起動の際に失敗する可能性があります。
$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[ansible@aap26 ~]$ systemctl --user list-units --type=service --all
UNIT LOAD ACTIVE SUB DESCRIPTION
automation-controller-rsyslog.service loaded inactive dead Podman automation-controller-rsyslog.service
automation-controller-task.service loaded inactive dead Podman automation-controller-task.service
automation-controller-web.service loaded inactive dead Podman automation-controller-web.service
automation-eda-activation-worker-1.service loaded inactive dead Podman automation-eda-activation-worker-1.service
automation-eda-activation-worker-2.service loaded inactive dead Podman automation-eda-activation-worker-2.service
automation-eda-api.service loaded inactive dead Podman automation-eda-api.service
automation-eda-daphne.service loaded inactive dead Podman automation-eda-daphne.service
automation-eda-scheduler.service loaded inactive dead Podman automation-eda-scheduler.service
automation-eda-web.service loaded inactive dead Podman automation-eda-web.service
automation-eda-worker-1.service loaded inactive dead Podman automation-eda-worker-1.service
automation-eda-worker-2.service loaded inactive dead Podman automation-eda-worker-2.service
automation-gateway-proxy.service loaded inactive dead Podman automation-gateway-proxy.service
automation-gateway.service loaded inactive dead Podman automation-gateway.service
automation-hub-api.service loaded inactive dead Podman automation-hub-api.service
automation-hub-content.service loaded inactive dead Podman automation-hub-content.service
automation-hub-web.service loaded inactive dead Podman automation-hub-web.service
automation-hub-worker-1.service loaded inactive dead Podman automation-hub-worker-1.service
automation-hub-worker-2.service loaded inactive dead Podman automation-hub-worker-2.service
dbus-broker.service loaded active running D-Bus User Message Bus
grub-boot-success.service loaded inactive dead Mark boot as successful
podman.service loaded inactive dead Podman API Service
postgresql.service loaded inactive dead Podman postgresql.service
* receptor.service loaded failed failed Podman receptor.service
redis-tcp.service loaded inactive dead Podman redis-tcp.service
redis-unix.service loaded inactive dead Podman redis-unix.service
systemd-tmpfiles-clean.service loaded inactive dead Cleanup of User's Temporary Files and Directories
systemd-tmpfiles-setup.service loaded active exited Create User's Volatile Files and Directories
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
27 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
サービス起動実行
先ほどの停止スクリプトを利用してサービス・スタートを行います。
$ for svc in $(systemctl --user list-units --type=service --all | grep .service | grep -Ev 'systemd-tmpfiles|dbus-broker|podman.service|grub-boot-success.service' | awk '{print $1}')
> do
> systemctl --user start "$svc"
> done
Failed to start AAP26.service: Unit AAP26.service not found.
Failed to start aap.service: Unit aap.service not found.
Failed to start ansible-automation-platform-containerized-setup-bundle-2.6-1-ppc64le.tar.gz.service: Unit ansible-automation-platform-containerized-setup-bundle-2.6-1-ppc64le.tar.gz.service not found.
Failed to start id_rsa_aap.service: Unit id_rsa_aap.service not found.
いくつかのサービスが見つからないというメッセージが出ていますが、実際に起動していないサービスはreceptor.service のみでした。
$ systemctl --user list-units --type=service --all
UNIT LOAD ACTIVE SUB DESCRIPTION
automation-controller-rsyslog.service loaded active running Podman automation-controller-rsyslog.service
automation-controller-task.service loaded active running Podman automation-controller-task.service
automation-controller-web.service loaded active running Podman automation-controller-web.service
automation-eda-activation-worker-1.service loaded active running Podman automation-eda-activation-worker-1.service
automation-eda-activation-worker-2.service loaded active running Podman automation-eda-activation-worker-2.service
automation-eda-api.service loaded active running Podman automation-eda-api.service
automation-eda-daphne.service loaded active running Podman automation-eda-daphne.service
automation-eda-scheduler.service loaded active running Podman automation-eda-scheduler.service
automation-eda-web.service loaded active running Podman automation-eda-web.service
automation-eda-worker-1.service loaded active running Podman automation-eda-worker-1.service
automation-eda-worker-2.service loaded active running Podman automation-eda-worker-2.service
automation-gateway-proxy.service loaded active running Podman automation-gateway-proxy.service
automation-gateway.service loaded active running Podman automation-gateway.service
automation-hub-api.service loaded active running Podman automation-hub-api.service
automation-hub-content.service loaded active running Podman automation-hub-content.service
automation-hub-web.service loaded active running Podman automation-hub-web.service
automation-hub-worker-1.service loaded active running Podman automation-hub-worker-1.service
automation-hub-worker-2.service loaded active running Podman automation-hub-worker-2.service
dbus-broker.service loaded active running D-Bus User Message Bus
grub-boot-success.service loaded inactive dead Mark boot as successful
podman.service loaded inactive dead Podman API Service
postgresql.service loaded active running Podman postgresql.service
* receptor.service loaded failed failed Podman receptor.service
redis-tcp.service loaded active running Podman redis-tcp.service
redis-unix.service loaded active running Podman redis-unix.service
systemd-tmpfiles-clean.service loaded inactive dead Cleanup of User's Temporary Files and Directories
systemd-tmpfiles-setup.service loaded active exited Create User's Volatile Files and Directories
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
27 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
pod 起動の確認すると、対象サービスの Pod も起動しているようでした。
$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
406917282ad9 registry.redhat.io/rhel9/postgresql-15:latest run-postgresql 13 days ago Up 2 minutes 5432/tcp postgresql
9c100dbb22d2 registry.redhat.io/rhel9/redis-6:latest run-redis 13 days ago Up 2 minutes 6379/tcp redis-unix
2c922a73508a registry.redhat.io/rhel9/redis-6:latest run-redis 13 days ago Up 2 minutes 6379/tcp redis-tcp
eb0aea41522d registry.redhat.io/ansible-automation-platform-26/gateway-proxy-rhel9:latest /usr/bin/envoy --... 13 days ago Up 2 minutes automation-gateway-proxy
198c5e26c451 registry.redhat.io/ansible-automation-platform-26/gateway-rhel9:latest /usr/bin/supervis... 13 days ago Up 2 minutes automation-gateway
16b767c3b7fa registry.redhat.io/ansible-automation-platform-26/controller-rhel9:latest /usr/bin/launch_a... 13 days ago Up 2 minutes 8052/tcp automation-controller-rsyslog
83b0221b9349 registry.redhat.io/ansible-automation-platform-26/controller-rhel9:latest /usr/bin/launch_a... 13 days ago Up 9 seconds 8052/tcp automation-controller-task
eca157dbf3df registry.redhat.io/ansible-automation-platform-26/controller-rhel9:latest /usr/bin/launch_a... 13 days ago Up 2 minutes 8052/tcp automation-controller-web
23457b2df66f registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9:latest gunicorn --bind 1... 13 days ago Up 2 minutes automation-eda-api
8b205c3b0892 registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9:latest daphne --bind 127... 13 days ago Up 2 minutes automation-eda-daphne
e3835a586746 registry.redhat.io/ansible-automation-platform-26/eda-controller-ui-rhel9:latest /bin/sh -c nginx ... 13 days ago Up 2 minutes 8080/tcp, 8443/tcp automation-eda-web
0428037951ef registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9:latest aap-eda-manage rq... 13 days ago Up 2 minutes automation-eda-worker-1
7c1db45e1043 registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9:latest aap-eda-manage rq... 13 days ago Up 2 minutes automation-eda-worker-2
c58018563af8 registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9:latest aap-eda-manage rq... 13 days ago Up 2 minutes automation-eda-activation-worker-1
6788768f522e registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9:latest aap-eda-manage rq... 13 days ago Up 2 minutes automation-eda-activation-worker-2
c70264aeaa43 registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9:latest aap-eda-manage sc... 13 days ago Up 2 minutes automation-eda-scheduler
b2d6ac1e429b registry.redhat.io/ansible-automation-platform-26/hub-rhel9:latest pulpcore-api --na... 13 days ago Up 2 minutes automation-hub-api
b92262d7a499 registry.redhat.io/ansible-automation-platform-26/hub-rhel9:latest pulpcore-content ... 13 days ago Up 2 minutes automation-hub-content
d52cde0d311e registry.redhat.io/ansible-automation-platform-26/hub-web-rhel9:latest /bin/sh -c nginx ... 13 days ago Up 2 minutes 8080/tcp, 8443/tcp automation-hub-web
923e9b40d452 registry.redhat.io/ansible-automation-platform-26/hub-rhel9:latest pulpcore-worker 13 days ago Up 2 minutes automation-hub-worker-1
52c2ba3ea2de registry.redhat.io/ansible-automation-platform-26/hub-rhel9:latest pulpcore-worker 13 days ago Up 2 minutes automation-hub-worker-2
しかし、稼働中は21個で元の状態から 1つ足りません。サービスがfailed 状態の receptor.service と考えられます。
$ podman ps | grep -v IMAGE | wc -l
21
-
receptor.serviceの個別起動
$ systemctl --user start receptor.service
$ echo $?
0
確認
サービスは無事稼働しています。
$ systemctl --user list-units --type=service --all | grep receptor.service
receptor.service loaded active running Podman receptor.service
Pod も22個稼働が確認できました。
$ podman ps | grep -v IMAGE | wc -l
22
receptor pod が稼働しています。
$ podman ps | grep receptor
f836ba64c6ee registry.redhat.io/ansible-automation-platform-26/receptor-rhel9:latest /usr/bin/receptor... 13 days ago Up 15 seconds receptor
全ての対象サービス、Pod の稼働を確認できました。
まとめ
- コンテナ版のAAPサービスはインストールに使用したユーザーの systemd でサービス自動起動設定が行われている。そのためOS停止起動で自動的に停止、起動が行われる
- 手動で停止・起動するには、対象サービスを指定して停止、起動することで実行可能
以上です。