• Ansible-Tower web界面管理安装


    Ansible-Tower web界面管理安装

    Ansible-Tower 介绍

    Ansible-Tower(之前叫做awx)是将ansible的指令界面化,简明直观,简单易用。Ansibke-tower其实就是一个图形化的任务调度,复杂服务部署,IT自动化的一个管理平台,属于发布配置管理系统,支持Api及界面操作,Django编写。Ansible-tower可以通过界面从github拉取最新playbook实施服务部署,提高生产效率。当然它也提供一个RESET API和命令行的CLI以供python脚本调用。

    如下安装成功,破解没成功--------使用下面低版本
    wget https://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-3.7.1-1.tar.gz
    
    tar -zxvf ansible-tower-setup-3.7.1-1.tar.gz 
    
    cd ansible-tower-setup-3.7.1-1
    
    vim inventory 
    sed -i "s#password=''#password='tower@123'#g" inventory
    sed -i "s#host=''#host='127.0.0.1'#g" inventory
    sed -i "s#port=''#port='5432'#g" inventory
    mkdir -p /var/log/tower
    系统要求 2核 内存4G
    ./setup.sh 
    
    安装成功后
    浏览器访问: https://172.16.72.131/ 输入用户名和密码
    
    ansible-tower-service stop
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    申请的免费版license最多只能添加10个主机, 且有时间限制 下面记录下破解方法:失败了,因为版本太高
    cd /var/lib/awx/venv/awx/lib/python3.6/site-packages/tower_license
    
    新版本的破解失败--------------------------------------------------------
    发现最新版本或者高版本的ansible-tower没有__init__.py文件,需要对__init__.pyc进行反编译
    
    python --version
    pip --version
    
    yum install python-pip -y
    pip -V
    
    pip install uncompyle6
    uncompyle6 --version
    uncompyle6 __init__.pyc >__init__.py 报语法错误
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14

    安装低版本的 Ansible-Tower 但是 ansible也要低版本,不然安装失败
    报错: template error while templating string: no filter named ‘match’. String: {{ ( (pg_host is not defined or pg_host == ‘’ or pg_host == '127.0.0.1

    wget https://releases.ansible.com/ansible-tower/setup-bundle/ansible-tower-setup-bundle-3.2.6-1.el7.tar.gz
    
    • 1
    卸载Ansible-Tower
    yum list|grep ansible
    
    
    yum list installed
    yum remove ansible-tower
    yum remove ansible-tower-server
    yum remove ansible-tower-venv-ansible
    yum remove ansible-tower-venv-tower
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    这个版本的可以 -------成功

    参考链接: https://www.cnblogs.com/hujinzhong/p/12172903.html

    wget https://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-3.6.0-1.tar.gz
    
    tar -zxvf ansible-tower-setup-3.6.0-1.tar.gz
    
    cd ansible-tower-setup-3.6.0-1
    
    vim inventory 
    admin_password='tower'
    pg_password='tower'
    rabbitmq_password='tower'
    
    mkdir -p /var/log/tower
    chmod 777 /var/log/tower
    ./setup.sh
    
    cd /var/lib/awx/venv/awx/lib/python3.6/site-packages/tower_license
    
    wget https://bootstrap.pypa.io/get-pip.py
    python get-pip.py
    
    pip -V
    
    pip install uncompyle6
    uncompyle6 __init__.pyc >__init__.py
    
    #修改__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'))
    ...
     
    #------------------------------------------------------------------
    
    python -m py_compile __init__.py
    python -O -m py_compile __init__.py
    
    ansible-tower-service restart
    
    wget -O /etc/yum.repos.d/ansible-awx.repo https://copr.fedorainfracloud.org/coprs/mrmeee/ansible-awx/repo/epel-7/mrmeee-ansible-awx-epel-7.repo
    
    yum install -y ansible-awx
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64

    参考链接:
    https://www.cnblogs.com/hujinzhong/p/12172903.html
    https://www.cnblogs.com/kevingrace/p/11306540.html
    https://github.com/nhz94259/rainbow-oneInch-perday/tree/master/doc
    https://www.cnblogs.com/nhz-M/p/10720913.html
    https://www.jianshu.com/p/804832965259
    https://blog.csdn.net/qq_33633013/article/details/82108104
    https://docs.ansible.com/ansible-tower/2.3.0/html/towerapi/intro.html
    https://gitee.com/lwr_dgas/AnsibleUI?_from=gitee_search

  • 相关阅读:
    osg 操作 NodePathList 节点操作
    HTML - input type=file 允许用户选择多个文件
    ch4-1时域到频域(短时分析)
    2022年阿里云双十一金秋云创季:轻量应用服务器2核2G,1年低至49.68元
    路由器实现 IP 子网之间的通信
    转行软件测试,薪资10K | 真正明智的人,懂得脚踏实地 ...
    代码随想录刷题记录 5 - 栈和队列
    25岁实现财富自由,戴志康告诉你什么样的技术人适合创业
    (第一天:)1.字典赋值默认值、字典解压赋值
    基于Admin.NET框架的前端的一些改进和代码生成处理(2)
  • 原文地址:https://blog.csdn.net/yinjl123/article/details/136262173