第 4 章 基础架构迁移
为了从 Ansible Automation Platform 1.2 迁移到 Ansible Automation Platform 2,此参考环境可以利用 Ansible Automation Platform 安装程序的功能。
使用 Ansible Automation Platform 安装程序,您可以通过几个简单命令备份、导入和升级到最新的 Ansible Automation Platform 2。
以下小节提供了此过程的逐步。
4.1. 在 环境 A上备份 Ansible Automation Platform 1.2
当环境 A 中的 Ansible Automation Platform 1.2 环境 包含我们的所有数据时,以下命令会在 环境 A 上使用 Ansible Automation Platform 安装程序创建备份。
在进行备份之前,请确保没有计划运行的当前正在运行的作业或将来的作业。进行备份后收集的任何数据都将为 LOST。
在 环境 A 中,
以
ansible
用户身份登录$ ssh ansible@enva_controller1.example.com
注意此引用环境使用
enva_controller1
作为包含 Ansible Automation Platform 安装程序目录和二进制文件的主机。进入
ansible-tower-setup-3.8.5-X
目录$ cd /path/to/ansible-tower-setup-3.8.5-X
运行 Ansible Automation Platform 安装程序以创建备份
-
backup_dest
提供存储 Ansible Automation Platform 数据库备份的位置 -
use_compression
缩小 Ansible Automation Platform 数据库备份的大小 -
@credentials.yml
传递密码变量及其值通过ansible-vault
加密 -
--ask-vault-pass
请求用于访问加密credentials.yml
文件的密码 -b
将创建备份选项设置为 True$ ./setup.sh -e 'backup_dest=<mount_point>' -e 'use_compression=True' -e @credentials.yml -b
-
此参考环境利用了加密凭证,且不以纯文本形式包含密码。附录 C, 创建加密的 credentials.yml 文件 中详细介绍了如何使用 ansible-vault
加密您的凭证。
备份过程可能需要一些时间才能完成。