一、環境準備:
CentOS Linux release 7.5.1804 (Core)
主機地址:9.110.187.203
ansible版本:2.6.4
ansible-tower版本:3.2.6
[root@localhost ~]#yum -y install ansible
[root@localhost ~]# ansible --version
ansible 2.6.4
二、安裝ansible-tower:
[root@localhost ~]#wget https://releases.ansible.com/ansible-tower/setup-bundle/ansible-tower-setup-bundle-3.2.6-1.el7.tar.gz
[root@localhost ~]#tar -zxvf ansible-tower-setup-bundle-3.2.6-1.el7.tar.gz
[root@localhost ~]#cd ansible-tower-setup-bundle-3.2.6-1.el7
修改配置文件inventory將裏面所有的密碼都修改爲自己的密碼,如下三處的標紅地方:
[root@localhost ansible-tower-setup-bundle-3.2.6-1.el7]# pwd
/root/ansible-tower-setup-bundle-3.2.6-1.el7
[root@localhost ansible-tower-setup-bundle-3.2.6-1.el7]# ./setup.sh
如果網絡沒有問題的話耐心等待安裝完成即可.
安裝完成沒報錯的話即可訪問web頁面:https://9.110.187.203/#/,默認初始頁面如下:
默認用戶爲admin,密碼爲inventory文件admin_password字段配置的密碼,我這裏配置的密碼也爲admin.
導入license,沒有的話,點擊REQUEST LICENSE,去官方(https://www.ansible.com/license)申請免費試用,填寫個人信息後(郵箱要填寫正確,其他信息可隨便填寫)會把license發到填寫的郵箱.
提交license並登錄成功後默認初始頁面如下:
[root@localhost ansible-tower-setup-bundle-3.2.6-1.el7]# cd /var/lib/awx/venv/awx/lib/python2.7/site-packages/tower_license
vi __init__.py將119行和120行修改爲如下內容,特別需要注意格式,如下:
修改完重新編譯一下:
[root@localhost tower_license]# python -m py_compile __init__.py
[root@localhost tower_license]# python -O -m py_compile __init__.py
重啓服務:
[root@localhost tower_license]# ansible-tower-service restart
重新打開settings–VIEW YOUR LICENSE,發現"Hosts Available"變成了9999999臺,說明破解成功,如下: