惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
Vercel News
Vercel News
U
Unit 42
L
LangChain Blog
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare Blog
F
Fortinet All Blogs
小众软件
小众软件
I
InfoQ
P
Proofpoint News Feed
D
DataBreaches.Net
Martin Fowler
Martin Fowler
H
Help Net Security
T
Tailwind CSS Blog
N
Netflix TechBlog - Medium
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog

泠泫凝的异次元空间

通过串口安装Linux | 泠泫凝的异次元空间 curl自编译 | 泠泫凝的异次元空间 Minecraft 认证服务器代理 | 泠泫凝的异次元空间 飞塔分流配置实战 | 泠泫凝的异次元空间 Windows 安全启动证书检查 | 泠泫凝的异次元空间 Lxn-OneDriveCLI | 泠泫凝的异次元空间 华三交换机配置 ERPS 环网 | 泠泫凝的异次元空间 PVE 配置 VLAN 感知 | 泠泫凝的异次元空间 MT7922 无线网卡安装 | 泠泫凝的异次元空间 无显示输出 Linux 主机配置桌面显示 | 泠泫凝的异次元空间 Wireguard 部署 SOP 手册(自用) | 泠泫凝的异次元空间 Zabbix 7.4 通过钉钉发送告警提醒 | 泠泫凝的异次元空间 Debian with xfce 通过 VNC 共享屏幕 华三S6860 IRF堆叠 | 泠泫凝的异次元空间 iPad 应用侧载 | 泠泫凝的异次元空间 Smart DNS 分区解析 | 泠泫凝的异次元空间 建立 NFS 服务器并挂载到客户端 | 泠泫凝的异次元空间 将 Android 以 MTP 方式连接至 Debian PVE 虚拟机迁移至 vCenter | 泠泫凝的异次元空间 vCenter 虚拟机迁移至 PVE | 泠泫凝的异次元空间 PVE迁移时提示密钥验证失败 | 泠泫凝的异次元空间 修改Windows设备设置区域 | 泠泫凝的异次元空间 恢复 SecureCRT 7.x 保存的密码 | 泠泫凝的异次元空间 PVE 超融合下电与上电流程 | 泠泫凝的异次元空间 记一次Zabbix异常处理 | 泠泫凝的异次元空间 苹果设备保存SHSH2 | 泠泫凝的异次元空间 PVE超融合部署 | 泠泫凝的异次元空间 树莓派启用zram | 泠泫凝的异次元空间 在 Hyper-V 上安装 EVE-NG | 泠泫凝的异次元空间 Zabbix 部署与 Windows 硬件信息收集 | 泠泫凝的异次元空间
Ansible Tower 安装 | 泠泫凝的异次元空间
Lxn's Area · 2023-07-11 · via 泠泫凝的异次元空间

Ansible Tower是由RedHat开发的Ansible的图形化工具,能够以WebUI的方式实现Ansible的功能,提升管理效率。

截至本文发布前,Ansible Tower最新版本为3.8.6

  1. 首先到官方源下载安装包,也可以直接下载latest版本
    1
    wget https://releases.ansible.com/ansible-tower/setup-bundle/ansible-tower-setup-bundle-latest.tar.gz
  2. 解压
    1
    2
    tar -zxvf ansible-tower-setup-bundle-latest.el7.tar.gz
    cd ansible-tower-setup-bundle-3.8.6-2/
  3. 修改必要信息
    1
    nano inventory
    将配置文件中的密码填上
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    [all:vars]
    admin_password='password'

    pg_host=''
    pg_port=''

    pg_database='awx'
    pg_username='awx'
    pg_password='tower'
    pg_sslmode='prefer'
  4. 执行安装
    1
    ./setup.sh
  5. 等待执行完成后访问直接机器IP,即可出现登录页面,默认用户名是之前改的配置文件中的admin_password值。

非官方授权

/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/main/utils/licensing.py文件是有关Ansible Tower授权相关的核心代码部分,只要修改其中的部分代码绕过相关逻辑即可达到授权的目的。感谢玩脱了的奶鱼博主提供的思路。

打开该文件,找到validate函数,在attrs = copy.deepcopy(self._attrs)type = attrs.get('license_type', 'none')之间添加如下代码:

1
2
3
4
attrs['license_type'] = 'enterprise'    
attrs['instance_count'] = MAX_INSTANCES
attrs['license_date'] = '2567433600'
attrs['subscription_name'] = 'lxnchan'

然后将下方的授权类型(未授权)判定部分注释掉:

1
2
3



这个自定义函数全部改完之后看起来应该像这样:

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
def validate(self):

attrs = copy.deepcopy(self._attrs)

attrs['license_type'] = 'enterprise'
attrs['instance_count'] = MAX_INSTANCES
attrs['license_date'] = '2567433600'
attrs['subscription_name'] = 'lxnchan'

type = attrs.get('license_type', 'none')




attrs['valid_key'] = True

if Host:
current_instances = Host.objects.active_count()
else:
current_instances = 0
available_instances = int(attrs.get('instance_count', None) or 0)
attrs['current_instances'] = current_instances
attrs['available_instances'] = available_instances
free_instances = (available_instances - current_instances)
attrs['free_instances'] = max(0, free_instances)

license_date = int(attrs.get('license_date', 0) or 0)
current_date = int(time.time())
time_remaining = license_date - current_date
attrs['time_remaining'] = time_remaining
if attrs.setdefault('trial', False):
attrs['grace_period_remaining'] = time_remaining
else:
attrs['grace_period_remaining'] = (license_date + 2592000) - current_date
attrs['compliant'] = bool(time_remaining > 0 and free_instances >= 0)
attrs['date_warning'] = bool(time_remaining < self.SUBSCRIPTION_TIMEOUT)
attrs['date_expired'] = bool(time_remaining <= 0)
return attrs

改完之后重启Ansible Tower服务:

1
ansible-tower-service restart

然后强制刷新登录页即可看到已授权。


参考资料

相关链接

 上一篇

Linux ubuntu Python