2.3. 设置清单文件
在升级 Red Hat Ansible Automation Platform 安装前,请编辑 inventory 文件,使其与您的所需配置匹配。您可以从现有 Ansible Automation Platform 部署中保留相同的参数,或者修改参数以匹配环境的任何更改。
流程
进入安装程序目录。
- 捆绑的安装程序
$ cd ansible-automation-platform-setup-bundle-2.4-1-x86_64
- 在线安装程序
$ cd ansible-automation-platform-setup-2.4-1
-
打开
inventory文件以进行编辑。 修改
inventory文件,以置备新节点、取消置备节点或组,以及导入或生成自动化中心 API 令牌。如果没有更改环境,您可以使用现有 Ansible Automation Platform 2.1 安装中的同一
inventory文件。注意为 [automationhub] 和 [automationcontroller] 主机提供可访问 IP 地址或完全限定域名 (FDQN),以确保用户可以从不同节点从 Ansible 自动化中心同步和安装内容。不要使用
localhost。如果使用 localhost,则升级将作为 preflight 检查的一部分停止。
在集群中置备新节点
添加新节点以及
inventory文件中的现有节点,如下所示:[controller] clusternode1.example.com clusternode2.example.com clusternode3.example.com [all:vars] admin_password='password' pg_host='' pg_port='' pg_database='<database_name>' pg_username='<your_username>' pg_password='<your_password>'
在集群中取消置备节点或组
-
将
node_state-deprovision附加到inventory文件中的节点或组。
导入和生成 API 令牌
当从 Red Hat Ansible Automation Platform 2.0 或更早版本升级到 Red Hat Ansible Automation Platform 2.1 或更高版本时,您可以使用现有的自动化中心 API 令牌或生成新的令牌。在清单文件中,在运行 Red Hat Ansible Automation Platform 安装程序设置脚本 setup.sh 前编辑以下字段之一:
使用
automationhub_api_token标志导入现有的 API 令牌,如下所示:automationhub_api_token=<api_token>生成一个新的 API 令牌,并使用
generate_automationhub_token标志使任何现有令牌无效,如下所示:generate_automationhub_token=True