Documentation

8. 升级现有 Tower 安装

您可轻松地将现有 Tower 安装升级到最新版本。Tower 查找现有配置文件并识别何时应当执行升级而不是安装。

与安装一样,升级过程要求 Tower 服务器可以访问互联网。升级过程所需的时间与 Tower 安装的时间类似,此外还需要时间进行数据迁移。

此升级过程假定您已经安装了 Ansible 和 Tower。

注解

You can not convert an embedded-database Tower to a Clustered installation as part of an upgrade. Users who want to deploy Tower in a Clustered configuration should back up their Tower database, install a new Clustered configuration on a different VM or physical host, and then restore the database. It is possible to add additional instances later on to Tower if it is already operating on an external database. Refer to the Clustering chapter of the Ansible Tower Administration Guide.

如果 Tower 位于 RHEL 8 之前的版本上,并且您希望升级到使用 RHEL 8 的 Ansible Tower,请按照如下所示的顺序进行操作:

  1. RHEL 7:获取 Ansible Automation Platform 安装程序 及升级到 Ansible Tower 3.8

  2. 运行 Tower 设置 playbook 中包括的 Tower 备份。详情请参阅 Ansible Tower Administration Guide 中的 Backing Up and Restoring Tower

  3. RHEL 8:获取 Ansible Automation Platform 安装程序 及升级到 Ansible Tower 3.8

  4. 运行包括在 Tower setup playbook 中的 Tower Restore。详情请参阅 Ansible Tower Administration GuideBacking Up and Restoring Tower

如果升级使用嵌入式数据库的 Tower,则此升级过程会确保 PostgreSQL 数据库也被正确地迁移到最新版本。取决于您的 Ansible Automation Platform 安装的规模,这个过程可能会需要一定时间来完成。请注意,如果您升级使用外部数据库的 Tower,数监控客户端的程序库也会被升级,但您需要手动升级外部 PostgreSQL 服务器。在升级前请查看发行注记中的相关内容。

如果 Tower 升级失败,或者您需要帮助,请通过红帽客户门户网站 (https://access.redhat.com/) 联络 Ansible。

8.1. 要求

在升级 Tower 安装前,请参阅 要求 以确保您有足够的磁盘空间和 RAM,并查看软件需求。例如,您应当在执行升级前安装最新的 Ansible 稳定版本。

注解

所有升级的系统版本不能比您当前要升级到的版本低两个主要版本。例如,要升级到 Ansible Tower 3.6.x,您必须首先是在使用版本 3.4.x,没有从版本 3.3.x 直接升级的路径。请参阅客户门户网站的 recommended upgrade path article

要在 RHEL 8 上运行 Ansible Tower 3.8,还必须安装 Ansible 2.9 或更高版本。

Subscriptions from Satellite can be applied to a Tower instance by providing a Satellite username and password with access to subscriptions. To take advantage of this, you must register your Tower node with Satellite by installing the Katello RPM before upgrading to Tower 3.8.x. See Installing Satellite instances on Tower for more information.

8.2. 备份您的 Tower 安装

建议您在升级系统前创建备份。完成备份过程后,再执行 OS/Ansible/Tower 升级。

请参考 Ansible Tower Administration GuideBacking Up and Restoring Tower

8.3. Setup Playbook

Tower 的设置(setup)playbook 脚本使用 inventory 文件,它通过 Tower 安装程序 tarball 被解包到的目录中的 ./setup.sh 运行。

root@localhost:~$ ./setup.sh

设置脚本使用以下参数:

  • -h -- 显示帮助信息并退出

  • -i INVENTORY_FILE -- 到 Ansible 清单文件的路径(默认: inventory

  • -e EXTRA_VARS -- 使用 key=value 或 YAML/JSON 设置额外的 Ansible 变量(例如, -e bundle_install=false 强制在线安装)

  • -b -- 在安装时执行数据库备份

  • -r -- 在安装时执行数据库恢复(除非通过 EXTRA_VARS 提供了一个非默认的路径,使用默认的恢复路径。如下所示)

./setup.sh -e 'restore_backup_file=/path/to/nondefault/location' -r