Press "Enter" to skip to content

ansible-tower安装以及破解(亲测可用)

[root@test01 ~]# uname -a
Linux test01 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@test01 ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
主机地址:192.168.139.139
ansible版本:2.6.2
ansible-tower版本:3.2.6

具体步骤:
安装ansible:
[root@test01 ~]# yum install -y ansible
ansible简单使用参考:https://www.tracymc.cn/archives/519
安装ansible-tower:
[root@test01 ~]# wget https://releases.ansible.com/ansible-tower/setup-bundle/ansible-tower-setup-bundle-3.2.6-1.el7.tar.gz
[root@test01 ~]# tar -zxvf ansible-tower-setup-bundle-3.2.6-1.el7.tar.gz
[root@test01 ~]# cd ansible-tower-setup-bundle-3.2.6-1.el7
修改配置文件inventory将里面所有的密码都修改为自己的密码,填写如下三处的标红地方,如下:
[root@test01 ansible-tower-setup-bundle-3.2.6-1.el7]# pwd
/root/ansible-tower-setup-bundle-3.2.6-1.el7
[root@test01 ansible-tower-setup-bundle-3.2.6-1.el7]# cat inventory
[tower]
localhost ansible_connection=local

[database]

[all:vars]
admin_password='admin'

pg_host=''
pg_port=''

pg_database='awx'
pg_username='awx'
pg_password='admin'

rabbitmq_port=5672
rabbitmq_vhost=tower
rabbitmq_username=tower
rabbitmq_password='admin'
rabbitmq_cookie=cookiemonster

# Needs to be true for fqdns and ip addresses
rabbitmq_use_long_name=false

# Isolated Tower nodes automatically generate an RSA key for authentication;
# To disable this behavior, set this value to false
# isolated_key_generation=true
修改完配置文件执行安装,如下:
[root@test01 ansible-tower-setup-bundle-3.2.6-1.el7]# ./setup.sh
如果网络没有问题的话耐心等待安装完成即可.
安装完成没报错的话即可访问web页面:https://192.168.139.145/#/,默认初始页面如下:
默认用户为admin,密码为inventory文件admin_password字段配置的密码,我这里配置的密码也为admin.
导入license,没有的话,点击REQUEST LICENSE,去官方(https://www.ansible.com/license)申请免费试用,填写个人信息后(邮箱要填写正确,其他信息可随便填写)会把license发到填写的邮箱.
提交license并登录成功后默认初始页面如下:

Tower无限hosts的License破解:
破解前打开settings–VIEW YOUR LICENSE,"Hosts Available"只有10台.
破解过程:
[root@test01 tower_license]# cd /var/lib/awx/venv/awx/lib/python2.7/site-packages/tower_license
vi __init__.py将119行和120行修改为如下内容,特别需要注意格式,如下:
修改完重新编译一下:
[root@test01 tower_license]# python -m py_compile __init__.py
[root@test01 tower_license]# python -O -m py_compile __init__.py
重启服务:
[root@test01 tower_license]# ansible-tower-service restart
重新打开settings–VIEW YOUR LICENSE,发现"Hosts Available"变成了9999999台,说明破解成功,如下:

Be First to Comment

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注