本文主要是介绍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.gztar -zxvf ansible-tower-setup-3.7.1-1.tar.gz cd ansible-tower-setup-3.7.1-1vim 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个主机, 且有时间限制 下面记录下破解方法:失败了,因为版本太高
cd /var/lib/awx/venv/awx/lib/python3.6/site-packages/tower_license新版本的破解失败--------------------------------------------------------
发现最新版本或者高版本的ansible-tower没有__init__.py文件,需要对__init__.pyc进行反编译python --version
pip --versionyum install python-pip -y
pip -Vpip 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
wget https://releases.ansible.com/ansible-tower/setup-bundle/ansible-tower-setup-bundle-3.2.6-1.el7.tar.gz
卸载Ansible-Tower
yum list|grep ansibleyum 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
wget https://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-3.6.0-1.tar.gztar -zxvf ansible-tower-setup-3.6.0-1.tar.gzcd ansible-tower-setup-3.6.0-1vim inventory
admin_password='tower'
pg_password='tower'
rabbitmq_password='tower'mkdir -p /var/log/tower
chmod 777 /var/log/tower
./setup.shcd /var/lib/awx/venv/awx/lib/python3.6/site-packages/tower_licensewget https://bootstrap.pypa.io/get-pip.py
python get-pip.pypip -Vpip 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 Trueelse:if os.path.isdir('/opt/rh/cfme-appliance'):if os.path.isdir('/opt/rh/cfme-gemset'):passtry:has_rpms = subprocess.call(['rpm', '--quiet', '-q', 'cfme', 'cfme-appliance', 'cfme-gemset'])if has_rpms == 0:return Trueexcept OSError:passreturn 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__.pyansible-tower-service restartwget -O /etc/yum.repos.d/ansible-awx.repo https://copr.fedorainfracloud.org/coprs/mrmeee/ansible-awx/repo/epel-7/mrmeee-ansible-awx-epel-7.repoyum 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
这篇关于Ansible-Tower web界面管理安装的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!