4.3. 将 环境 B 升级到 Ansible Automation Platform 2
成功导入 Ansible Automation Platform 数据库后,迁移过程中的最后一步是将 环境 B Ansible Automation Platform 1.2 环境升级到 Ansible Automation Platform 2,并扩展环境 B 的架构,如 图 1.4 “扩展环境 B 架构概述” 所示。
在 环境 B 中,
以
ansible用户身份登录ssh ansible@envb_controller1.example.com
$ ssh ansible@envb_controller1.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow 注意此引用环境使用
envb_controller1作为包含 Ansible Automation Platform 安装程序目录和二进制文件的主机。下载 Ansible Automation Platform 2.1.1 Setup tar ansible-automation-platform-setup-2.1.1-1.tar.gz
注意对于断开连接的安装,请下载 Ansible Automation Platform 2.1.1 Setup Bundle
解压 ansible-automation-platform-setup-2.1.1-1.tar.gz
tar zxvf ansible-automation-platform-setup-2.1.1-1.tar.gz
$ tar zxvf ansible-automation-platform-setup-2.1.1-1.tar.gzCopy to Clipboard Copied! Toggle word wrap Toggle overflow 将目录改为 ansible-automation-platform-setup-2.1.1-1
cd ansible-automation-platform-setup-2.1.1-1/
$ cd ansible-automation-platform-setup-2.1.1-1/Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将 Ansible Automation Platform 1.2 清单文件复制到 ansible-automation-platform-setup-2.1.1-1 目录中
cp /path/to/ansible-tower-setup-3.8.5-X/inventory .
$ cp /path/to/ansible-tower-setup-3.8.5-X/inventory .Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用 Ansible Automation Platform 安装程序复制的 Ansible Automation Platform 1.2 清单文件生成 Ansible Automation Platform 2 安装清单提议
./setup.sh
$ ./setup.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow 注意Ansible-core在此过程中安装(如果尚未安装)。警告在创建提议 inventory.new.ini 时,预期的 Ansible Automation Platform 安装程序会在进程早期失败。
预期错误任务类似如下:
TASK [ansible.automation_platform_installer.check_config_static : Detect pre-2.x inventory and offer a migration] *** fatal: [172.16.58.48 -> localhost]: FAILED! => {"changed": false, "msg": "The installer has detected that you are using an inventory format from a version prior to 4.0. We have created an example inventory based on your old style inventory. Please check the file `/home/ansible/aap_install-2.1.1/ansible-automation-platform-setup-bundle-2.1.1-2/inventory.new.ini` and make necessary adjustments so that the file can be used by the installer."}TASK [ansible.automation_platform_installer.check_config_static : Detect pre-2.x inventory and offer a migration] *** fatal: [172.16.58.48 -> localhost]: FAILED! => {"changed": false, "msg": "The installer has detected that you are using an inventory format from a version prior to 4.0. We have created an example inventory based on your old style inventory. Please check the file `/home/ansible/aap_install-2.1.1/ansible-automation-platform-setup-bundle-2.1.1-2/inventory.new.ini` and make necessary adjustments so that the file can be used by the installer."}Copy to Clipboard Copied! Toggle word wrap Toggle overflow 建议 inventory.new.ini
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意变量
admin_password、pg_password和registry_password不是 inventory.new.ini 文件的一部分,因为不建议以纯文本形式存储密码。改为使用加密的 credentials.yml 文件。创建建议的
inventory.new.ini后,修改该文件,使其包含包含跃点节点和执行节点的扩展环境 B 架构扩展环境 B inventory.new.ini
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用以下选项运行
setup.sh以升级到 Ansible Automation Platform 2./setup.sh -i inventory.new.ini -e @credentials.yml -- --ask-vault-pass
$ ./setup.sh -i inventory.new.ini -e @credentials.yml -- --ask-vault-passCopy to Clipboard Copied! Toggle word wrap Toggle overflow 验证所有自动化控制器节点都可以访问 Ansible Automation Platform 仪表板 UI。
注意如果您在通过任何自动化控制器访问 Ansible Automation Platform 仪表板时遇到 502 错误或安全连接失败,这可能是因为以下其中一个或两个问题:
- 证书不匹配
-
nginx的 SELinux 上下文不正确
附录 D, 升级后 playbook 提供了修复这些问题的临时解决方案。当前正在实施修复,并在即将发布的点版本中修复。
证书不匹配的问题已在 2.1.2 版和 Ansible Automation Platform 版本中解决。
nginx的不正确的 SELinux 上下文仍然需要临时解决方案 Ansible Playbook。检查 附录 D, 升级后 playbook 以了解更多详情。
此引用环境将 credentials.yml 用于以下变量:* admin_password * registry_password * pg_password
有关清单文件中可设置的不同值的更多信息,请访问: 设置清单文件