Ansible之AWX安装部署

目录

环境说明


安装部署

依赖说明
安装ansible
# yum install epel-release
# yum install ansible
安装 Docker
# yum install -y yum-utils   device-mapper-persistent-data   lvm2
# yum-config-manager     --add-repo     https://download.docker.com/linux/centos/docker-ce.repo
# yum install docker-ce docker-ce-cli containerd.io
# systemctl start docker
# systemctl enable docker
配置Docker镜像加速

参考:DaoCloud

# curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io
# systemctl restart docker
安装 docker-compose 的Python模块
# yum install python3-pip
# pip3 install docker-compose
安装 Docker Compose
# curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# chmod +x /usr/local/bin/docker-compose
#  ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
# docker-compose --version
docker-compose version 1.24.1, build 4667896

下载 AWX项目、配置、部署

# git glone https://github.com/ansible/awx
# cd awx/installer/

修改配置 inventory文件配置

pg_password=***
rabbitmq_password=***
admin_password=***

部署安装

# ansible-playbook -i inventory install.yml

等待Docker容器启动

# docker ps -a
CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS              PORTS                                                 NAMES
aa86f7189b6e        ansible/awx_task:9.0.1       "/tini -- /bin/sh -c…"   7 days ago          Up 7 days           8052/tcp                                              awx_task
9ef2408a1105        ansible/awx_web:9.0.1        "/tini -- /bin/sh -c…"   7 days ago          Up 7 days           0.0.0.0:80->8052/tcp                                  awx_web
de4be7e37ca5        postgres:10                  "docker-entrypoint.s…"   7 days ago          Up 7 days           5432/tcp                                              awx_postgres
66167deaf9e4        ansible/awx_rabbitmq:3.7.4   "docker-entrypoint.s…"   7 days ago          Up 7 days           4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 25672/tcp   awx_rabbitmq
536f2596655d        memcached:alpine             "docker-entrypoint.s…"   7 days ago          Up 7 days           11211/tcp                                             awx_memcached

部署完成,浏览器访问本机IP地址,默认使用80端口