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脚本调用。

如下安装成功,破解没成功--------使用下面低版本
shell 复制代码
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
申请的免费版license最多只能添加10个主机, 且有时间限制 下面记录下破解方法:失败了,因为版本太高
shell 复制代码
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 报语法错误

安装低版本的 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

shell 复制代码
wget https://releases.ansible.com/ansible-tower/setup-bundle/ansible-tower-setup-bundle-3.2.6-1.el7.tar.gz
卸载Ansible-Tower
shell 复制代码
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
这个版本的可以 -------成功

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

shell 复制代码
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

参考链接:

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

相关推荐
Johny_Zhao1 小时前
AI+自动化测试系统方案:网络设备与网络应用智能测试
linux·网络·人工智能·python·网络安全·docker·ai·信息安全·云计算·ansible·shell·cisco·huawei·系统运维·itsm·华三·deepseek
IT成长日记13 小时前
【Ansible基础】Ansible设计理念与无代理架构深度解析
架构·自动化·ansible·无代理
IT成长日记1 天前
【Ansible基础】Ansible执行流程详解:从Playbook到实际任务
ansible·playbook·执行流程
麦a~M了M2 天前
ansible
linux·运维·ansible
IT成长日记3 天前
【Ansible基础】Ansible 核心组件深度解析:控制节点、受管节点、Inventory与Playbook
ansible·playbook·控制节点·受管节点·inventory
sky北城4 天前
ansible进阶02
ansible
重启就好4 天前
【Ansible】之inventory主机清单
运维·ansible
xmweisi024 天前
Ansible内置模块之 group
linux·运维·ansible·rhce·rhca·红帽认证
一直奔跑在路上5 天前
【Ansible】基于windows主机,采用NTLM+HTTPS 认证部署
windows·https·ansible
遇见火星5 天前
Ansible模块——从控制节点向目标主机复制文件!
java·服务器·ansible