其他分享
首页 > 其他分享> > Ansible-tower安装

Ansible-tower安装

作者:互联网

目录

安装

安装包下载
https://releases.ansible.com/ansible-tower/setup-bundle/ansible-tower-setup-bundle-3.6.0-1.el7.tar.gz
上传到服务器,(系统centos7.4+
解压

tar –xvzf ansible-tower-setup-bundle-3.6.0-1.el7.tar.gz
cd ansible-tower-setup-bundle-3.6.0-1/

修改配置文件

[root@tower ansible-tower-setup-bundle-3.6.0-1]# vim inventory
[tower]
localhost ansible_connection=local
 
[database]
 
[all:vars]
admin_password='tower'   #tower登录密码
 
pg_host=''
pg_port=''
 
pg_database='awx'
pg_username='awx'
pg_password='tower'
pg_sslmode='prefer'  # set to 'verify-full' for client-side enforced SSL
 
rabbitmq_username=tower
rabbitmq_password='tower'
rabbitmq_cookie=cookiemonster


开始安装
image

安装之前需要先安装rsync, rsync是linux系统下的数据镜像备份工具

[root@tower ansible-tower-setup-bundle-3.6.0-1]# yum -y install rsync
[root@tower ansible-tower-setup-bundle-3.6.0-1]#./setup.sh

安装成功
image

访问https://ip
image

需要认证:
image

破解

[root@tower ~]# cd /var/lib/awx/venv/awx/lib/python3.6/site-packages/tower_license
[root@tower tower_license]# ll
total 8
-rw-r--r-- 1 root root 7764 Dec 14 01:39 __init__.pyc
drwxr-xr-x 2 root root   37 Jan 12 11:46 __pycache__
 
#安装pip
[root@tower tower_license]# wget https://bootstrap.pypa.io/get-pip.py
[root@tower tower_license]# python get-pip.py
[root@tower tower_license]# pip -V
pip 19.3.1 from /usr/lib/python2.7/site-packages/pip (python 2.7)
[root@tower tower_license]# pip install uncompyle6
 
#反汇编init.pyc
[root@tower tower_license]# uncompyle6 __init__.pyc >__init__.py
[root@tower tower_license]# ll
total 20
-rw-r--r-- 1 root root 11502 Jan 12 12:04 __init__.py
-rw-r--r-- 1 root root  7764 Dec 14 01:39 __init__.pyc
drwxr-xr-x 2 root root    37 Jan 12 11:46 __pycache__
 
#修改__init__.py文件
    def _check_cloudforms_subscription(self):
        return True    #添加这一行
        if os.path.exists('/var/lib/awx/i18n.db'):
            return True
        else:
            if os.path.isdir('/opt/rh/cfme-appliance'):
                if os.path.isdir('/opt/rh/cfme-gemset'):
                    pass
            try:
                has_rpms = subprocess.call(['rpm', '--quiet', '-q', 'cfme', 'cfme-appliance', 'cfme-gemset'])
                if has_rpms == 0:
                    return True
            except OSError:
                pass
 
            return False
....
 
#修改"license_date=253370764800L" 为 "license_date=253370764800"
    def _generate_cloudforms_subscription(self):
        self._attrs.update(dict(company_name='Red Hat CloudForms License', instance_count=MAX_INSTANCES,
          license_date=253370764800,  #修改
          license_key='xxxx',
          license_type='enterprise',
          subscription_name='Red Hat CloudForms License'))
...
 
#------------------------------------------------------------------

 
#修改完重新编译一下
[root@tower tower_license]# python -m py_compile __init__.py
[root@tower tower_license]# python -O -m py_compile __init__.py
[root@tower tower_license]# ll
total 36
-rw-r--r-- 1 root root 11521 Jan 12 12:08 __init__.py
-rw-r--r-- 1 root root  9181 Jan 12 12:08 __init__.pyc
-rw-r--r-- 1 root root  9181 Jan 12 12:08 __init__.pyo
drwxr-xr-x 2 root root    37 Jan 12 11:46 __pycache__
 
#重启服务
[root@tower tower_license]# ansible-tower-service restart
Restarting Tower
Redirecting to /bin/systemctl stop rh-postgresql10-postgresql.service
Redirecting to /bin/systemctl stop rabbitmq-server.service
Redirecting to /bin/systemctl stop nginx.service
Redirecting to /bin/systemctl stop supervisord.service
Redirecting to /bin/systemctl start rh-postgresql10-postgresql.service
Redirecting to /bin/systemctl start rabbitmq-server.service
Redirecting to /bin/systemctl start nginx.service
Redirecting to /bin/systemctl start supervisord.service

访问https://ip/#/license
image

破解成功

标签:__,license,--,安装,init,Ansible,tower,root
来源: https://www.cnblogs.com/kxln/p/15881962.html