0) 硬件要求
1. CPU---2 Core
2. Mem---4 GB
3. HD--- 20GB
1) 安装一个Minimal版本的CentOS7
2) 安装必须要的一些软件
[root@node1 ~]# yum install vim wget curl postgresql rsync python3-pip epel-release -y
3) 安装Ansible
[root@node1 ~]# yum install ansible -y
[root@node1 ~]# ansible --version
ansible 2.9.13
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Apr 2 2020, 13:16:51) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
4) 创建ansible-tower日志目录
[root@node1 ~]# mkdir -p /var/log/tower
5) 下载ansbile-tower
[root@node1 ~]# wget https://releases.ansible.com/ansible-tower/setup-bundle/ansible-tower-setup-bundle-3.6.6-1.tar.gz
6) 解压ansbile-tower
[root@node1 ~]# tar xvfz ansible-tower-setup-bundle-3.6.6-1.tar.gz
[root@node1 ~]# cd ansible-tower-setup-bundle-3.6.6-1/
[root@node1 ansible-tower-setup-bundle-3.6.6-1]#
7) 配置并安装ansbile-tower
# 设定admin账户的密码为admin
[root@node1 ansible-tower-setup-bundle-3.6.6-1]# sed -i "s#password=''#password='admin'#g" inventory
# 设定ansible主机IP地址为127.0.0.1
[root@node1 ansible-tower-setup-bundle-3.6.6-1]# sed -i "s#host=''#host='127.0.0.1'#g" inventory
# 设定端口admin
[root@node1 ansible-tower-setup-bundle-3.6.6-1]# sed -i "s#port=''#port='5432'#g" inventory
# 设定pg的密码
[root@node1 ansible-tower-setup-bundle-3.6.6-1]# sed -i "s#pg_password=''#pg_password='admin'#g" inventory
# 安装ansible-tower
[root@node1 ansible-tower-setup-bundle-3.6.6-1]# ./setup.sh
......
......
......
......
......
......
The setup process completed successfully.
Setup log saved to /var/log/tower/setup-2020-10-15-17:10:43.log
8) 破解ansbile-tower License
[root@node1 ansible-tower-setup-bundle-3.6.6-1]# cd /var/lib/awx/venv/awx/lib/python3.6/site-packages/tower_license
[root@node1 tower_license]# pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple uncompyle6
[root@node1 tower_license]# uncompyle6 __init__.pyc >__init__.py
[root@node1 tower_license]# rm -f __init__.pyc __init__.pyo
[root@node1 tower_license]# vim __init__.py
......
......
......
......
......
......
# 于87行之下增加如下内容
def _check_cloudforms_subscription(self):
return True
......
......
......
......
......
......
[root@node1 tower_license]# python3 -m py_compile __init__.py
[root@node1 tower_license]# python3 -O -m py_compile __init__.py
[root@node1 tower_license]# ansible-tower-service restart
9) 访问ansbile-tower
[浏览器]===>http://$ansible-tower-ip
![](./images/at1.png)
![](./images/at2.png)
|