AlmaLinux 9.5 Ansible AWXのインストール手順
環境
AlmaLinux release 9.5 (Teal Serval)
Podman systemd-nspawn
Kubernetes
操作方法
1.システム更新を行う
#sudo dnf update -y
依存パッケージをインストール
#sudo dnf install -y git curl wget vim tar gcc make
#sudo dnf install -y epel-release
#sudo dnf install -y git curl wget vim tar gcc make
#sudo dnf install -y epel-release
#sudo dnf install -y git curl wget vim tar gcc make #sudo dnf install -y epel-release
2.Podmanをインストールします
#sudo dnf install -y podman podman-compose
3.PythonとAnsibleをインストールします
#sudo dnf install -y python3 python3-pip
#pip3 install --upgrade pip
#pip3 install ansible
#sudo dnf install -y python3 python3-pip
#pip3 install --upgrade pip
#pip3 install ansible
#sudo dnf install -y python3 python3-pip #pip3 install --upgrade pip #pip3 install ansible
4.AWX CLIをインストールします
# pip3 install ansible-tower-cli
5.Kubernetesをインストールします
# curl -sfL https://get.k3s.io | sh -
# sudo systemctl status k3s
# curl -sfL https://get.k3s.io | sh -
# sudo systemctl status k3s
# curl -sfL https://get.k3s.io | sh - # sudo systemctl status k3s
インストール成功かどうか確認する
# kubectl get node
6.AWX Operatorをインストールします
# git clone https://github.com/ansible/awx-operator.git
# cd awx-operator
# git checkout tags/2.12.0 # 最新バージョン
# git clone https://github.com/ansible/awx-operator.git
# cd awx-operator
# git checkout tags/2.12.0 # 最新バージョン
# git clone https://github.com/ansible/awx-operator.git # cd awx-operator # git checkout tags/2.12.0 # 最新バージョン
# Operatorのインストール
export NAMESPACE=awx
kubectl create ns $NAMESPACE
make deploy NAMESPACE=$NAMESPACE
export NAMESPACE=awx
kubectl create ns $NAMESPACE
make deploy NAMESPACE=$NAMESPACE
export NAMESPACE=awx kubectl create ns $NAMESPACE make deploy NAMESPACE=$NAMESPACE
7.AWXインスタンスを作成します
# vi awx-deploy.yaml
内容
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: awx
namespace: awx
spec:
service_type: nodeport
ingress_type: none
hostname: awx.example.com
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: awx
namespace: awx
spec:
service_type: nodeport
ingress_type: none
hostname: awx.example.com
apiVersion: awx.ansible.com/v1beta1 kind: AWX metadata: name: awx namespace: awx spec: service_type: nodeport ingress_type: none hostname: awx.example.com
deployを設定します
# kubectl apply -f awx-deploy.yaml
# kubectl apply -f awx-deploy.yaml
# kubectl apply -f awx-deploy.yaml
Pod状態を確認します
kubectl get pods -n awx
8.AWX画面にアクセスする
# kubectl get svc -n awx
# kubectl get svc -n awx
# kubectl get svc -n awx
awx-serviceのNodePortを確認します.例30080
アクセスURL
http://IPアドレス:30080
ユーザーのパスワードを取得します
kubectl get secret awx-admin-password -n awx -o jsonpath="{.data.password}" | base64 --decode
kubectl get secret awx-admin-password -n awx -o jsonpath="{.data.password}" | base64 --decode
kubectl get secret awx-admin-password -n awx -o jsonpath="{.data.password}" | base64 --decode