Ansible : AWX インストール2026/07/14 |
|
Red Hat Ansible Tower のコミュニティエディション Ansible AWX のインストールです。
Ansible AWX の実装には、Kubernetes 環境が必要となります。 |
|
| [1] |
当例では、開発/テスト用途で便利な Minikube を使用します。 |
| [2] | 必要なパッケージをインストールしておきます。 |
|
root@dlp:~# apt -y install git make curl
|
| [3] | 任意の一般ユーザーで Minikube を起動します。 |
|
ubuntu@dlp:~$ minikube start --vm-driver=kvm2 --cpus=4 --memory=8g --addons=ingress
* minikube v1.38.1 on Ubuntu 26.04 (kvm/amd64)
* Using the kvm2 driver based on user configuration
! Starting v1.39.0, minikube will default to "containerd" container runtime. See #21973 for more info.
* Downloading VM boot image ...
> minikube-v1.38.0-amd64.iso....: 65 B / 65 B [---------] 100.00% ? p/s 0s
> minikube-v1.38.0-amd64.iso: 182.81 MiB / 370.55 MiB 49.33% 18.26 MiB p/
.....
.....
* Verifying ingress addon...
* Enabled addons: default-storageclass, storage-provisioner, ingress
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
ubuntu@dlp:~$ minikube status minikube type: Control Plane host: Running kubelet: Running apiserver: Running kubeconfig: Configuredubuntu@dlp:~$ kubectl get pods -A NAMESPACE NAME READY STATUS RESTARTS AGE ingress-nginx ingress-nginx-admission-create-mtn67 0/1 Completed 0 46s ingress-nginx ingress-nginx-admission-patch-t2vlp 0/1 Completed 1 46s ingress-nginx ingress-nginx-controller-596f8778bc-4tcnf 1/1 Running 0 46s kube-system coredns-7d764666f9-xszkl 1/1 Running 0 46s kube-system etcd-minikube 1/1 Running 0 52s kube-system kube-apiserver-minikube 1/1 Running 0 52s kube-system kube-controller-manager-minikube 1/1 Running 0 52s kube-system kube-proxy-dqk8n 1/1 Running 0 46s kube-system kube-scheduler-minikube 1/1 Running 0 52s kube-system storage-provisioner 1/1 Running 1 (15s ago) 50s |
| [4] | Ansible AWX をデプロイします。 |
|
# AWX に必要な AWX Operator を取得 ubuntu@dlp:~$ git clone https://github.com/ansible/awx-operator.git Cloning into 'awx-operator'... remote: Enumerating objects: 11496, done. remote: Counting objects: 100% (21/21), done. remote: Compressing objects: 100% (17/17), done. remote: Total 11496 (delta 5), reused 5 (delta 4), pack-reused 11475 (from 2) Receiving objects: 100% (11496/11496), 3.94 MiB | 20.70 MiB/s, done. Resolving deltas: 100% (6723/6723), done.
ubuntu@dlp:~$
cd awx-operator
# AWX Operator のバージョンを指定 # バージョンの確認 : https://github.com/ansible/awx-operator/releases ubuntu@dlp:~/awx-operator$ git checkout 2.19.1 Note: switching to '2.19.1'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example: git switch -c <new-branch-name> Or undo this operation with: git switch - Turn off this advice by setting config variable advice.detachedHead to false HEAD is now at dd37ebd Update index.md (#1904)
ubuntu@dlp:~/awx-operator$
vi ./config/default/manager_auth_proxy_patch.yaml # 18行目 : 変更 image: docker.io/kubebuilder/kube-rbac-proxy:v0.15.0 # AWX 用に任意のネームスペース名をセットして Operator をデプロイ ubuntu@dlp:~/awx-operator$ export NAMESPACE=ansible-awx ubuntu@dlp:~/awx-operator$ make deploy namespace/ansible-awx created customresourcedefinition.apiextensions.k8s.io/awxbackups.awx.ansible.com created customresourcedefinition.apiextensions.k8s.io/awxmeshingresses.awx.ansible.com created customresourcedefinition.apiextensions.k8s.io/awxrestores.awx.ansible.com created customresourcedefinition.apiextensions.k8s.io/awxs.awx.ansible.com created serviceaccount/awx-operator-controller-manager created role.rbac.authorization.k8s.io/awx-operator-awx-manager-role created role.rbac.authorization.k8s.io/awx-operator-leader-election-role created clusterrole.rbac.authorization.k8s.io/awx-operator-metrics-reader created clusterrole.rbac.authorization.k8s.io/awx-operator-proxy-role created rolebinding.rbac.authorization.k8s.io/awx-operator-awx-manager-rolebinding created rolebinding.rbac.authorization.k8s.io/awx-operator-leader-election-rolebinding created clusterrolebinding.rbac.authorization.k8s.io/awx-operator-proxy-rolebinding created configmap/awx-operator-awx-manager-config created service/awx-operator-controller-manager-metrics-service created deployment.apps/awx-operator-controller-manager createdubuntu@dlp:~/awx-operator$ kubectl get pods -n $NAMESPACE NAME READY STATUS RESTARTS AGE awx-operator-controller-manager-7dc5bd6bb6-gdgl5 2/2 Running 0 3m
ubuntu@dlp:~/awx-operator$
cp awx-demo.yml ansible-awx.yml ubuntu@dlp:~/awx-operator$ vi ansible-awx.yml # 任意のサービス名称に変更
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: ansible-awx
spec:
service_type: nodeport
# AWX 用のネームスペースを kubectl のコンテキストにセットして AWX をデプロイ ubuntu@dlp:~/awx-operator$ kubectl config set-context --current --namespace=$NAMESPACE Context "minikube" modified. ubuntu@dlp:~/awx-operator$ kubectl apply -f ansible-awx.yml awx.awx.ansible.com/ansible-awx created # 進行状況はログで確認可 ubuntu@dlp:~/awx-operator$ kubectl logs -f deployments/awx-operator-controller-manager -c awx-manager
.....
.....
--------------------------- Ansible Task StdOut -------------------------------
TASK [installer : Start installation if auto_upgrade is false and deployment is missing] ***
task path: /opt/ansible/roles/installer/tasks/main.yml:31
-------------------------------------------------------------------------------
{"level":"info","ts":"2026-07-14T01:03:13Z","logger":"logging_event_handler","msg":"[playbook task start]","name":"ansible-awx","namespace":"ansible-awx","gvk":"awx.ansible.com/v1beta1, Kind=AWX","event_type":"playbook_on_task_start","job":"1924734389431626189","EventData.Name":"installer : Start installation if auto_upgrade is false and deployment is missing"}
{"level":"info","ts":"2026-07-14T01:03:13Z","logger":"runner","msg":"Ansible-runner exited successfully","job":"1924734389431626189","name":"ansible-awx","namespace":"ansible-awx"}
----- Ansible Task Status Event StdOut (awx.ansible.com/v1beta1, Kind=AWX, ansible-awx/ansible-awx) -----
PLAY RECAP *********************************************************************
localhost : ok=88 changed=0 unreachable=0 failed=0 skipped=85 rescued=0 ignored=1
----------
# 最終的に上記のように failed=0 で終了していれば OK
ubuntu@dlp:~$ kubectl get pods -l "app.kubernetes.io/managed-by=awx-operator" NAME READY STATUS RESTARTS AGE ansible-awx-migration-24.6.1-vql95 0/1 Completed 0 6m31s ansible-awx-postgres-15-0 1/1 Running 0 8m4s ansible-awx-task-58b69f79c4-8stcb 4/4 Running 0 7m30s ansible-awx-web-8db8c68b9-kxntj 3/3 Running 0 7m31subuntu@dlp:~$ kubectl get service -l "app.kubernetes.io/managed-by=awx-operator" NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE ansible-awx-postgres-15 ClusterIP None <none> 5432/TCP 8m23s ansible-awx-service NodePort 10.108.109.207 <none> 80:31333/TCP 7m52s # サービス URL 確認 ubuntu@dlp:~$ minikube service ansible-awx-service --url -n ansible-awx http://192.168.39.152:31333 # 管理アカウントのパスワード 確認 ubuntu@dlp:~$ kubectl get secret ansible-awx-admin-password -o jsonpath="{.data.password}" | base64 --decode; echo CyoIYIhhKHv5i4Wfm2JI83lDPIreSSKq # Kubernetes クラスター外部からもアクセスできるようにするには要ポートフォワード # [10445] ⇒ Minikube インストールホストが待ち受けるポート ⇒ 任意の空きポートを指定すれば OK # [80] ⇒ AWX コンテナーが待ち受けているポート ubuntu@dlp:~$ kubectl port-forward service/ansible-awx-service --address 0.0.0.0 10445:80 Forwarding from 0.0.0.0:10445 -> 8052 |
| [5] | Web ブラウザーを起動して Ansible AWX にアクセスします。 Minikube インストールホスト ローカル からアクセスする場合は、確認したサービス URL へアクセスします。 ポートフォワードした場合は、ローカルネットワーク内の任意のコンピューターから [http://(Minikube インストールホスト のホスト名 または IP アドレス):(設定したポート)] へアクセスします。 アクセスするとログイン画面が表示されます。 ユーザー名 [admin], パスワードは確認した管理アカウントのパスワードでログイン可能です。 |
|
| [6] | 正常にログインすると、Ansible AWX のダッシュボードが表示されます。以上でインストール完了です。 |
|
| [7] | なお、画面例は英語表記となっていますが、日本語 OS でアクセスすれば、自動的に日本語表記となります。 |
|
| Sponsored Link |
|
|