ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Ansible-tower安装

2022-02-11 10:02:35  阅读:255  来源: 互联网

标签:__ license -- 安装 init Ansible tower root


目录

安装

安装包下载
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

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有