破解十个节点限制,此方法用于tower3.3.0之前的版本,3.3.1之后对/var/lib/awx/venv/awx/lib/python2.7/site-packages/tower_license文件做了加密处理。
无需申请试用授权文件
修改license验证
cd /var/lib/awx/venv/awx/lib/python2.7/site-packages/tower_license
vi __init__.py
新增120行, return True
119 def _check_cloudforms_subscription(self):
120 return True
以下摘取license验证部分代码
def __init__(self, **kwargs):
self._attrs = dict(
company_name='',
instance_count=0,
license_date=0,
license_key='UNLICENSED',
)
if not kwargs:
kwargs = getattr(settings, 'LICENSE', None) or {}
self._attrs.update(kwargs)
self._attrs['license_date'] = int(self._attrs['license_date'])
if not self._attrs.get('subscription_name', None):
self._attrs['subscription_name'] = self._generate_subscription_name()
if self._check_cloudforms_subscription():
self._generate_cloudforms_subscription()
def _generate_cloudforms_subscription(self):
self._attrs.update(dict(company_name="Red Hat CloudForms License",
instance_count=9999999,
license_date=253370764800,
license_key='CodyGuo',
license_type='enterprise',
subscription_name='Red Hat CloudForms License'))
def _check_cloudforms_subscription(self):
return True
if os.path.exists('/var/lib/awx/i18n.db'):
return True
if os.path.isdir("/opt/rh/cfme-appliance") and os.path.isdir("/opt/rh/cfme-gemset"):
try:
has_rpms = subprocess.call(["rpm", "--quiet", "-q", "cfme", "cfme-appliance", "cfme-gemset"])
if has_rpms == 0:
return True
except OSError:
pass
return False
---------------------
编译
python -m py_compile __init__.py
python -O -m py_compile __init__.py
重启服务
ansible-tower-service restart
验证
打开–settings–config tower-- LICENSE 查看
20190103150958.png
网友评论