Red Hat Ansible Automation Platform Upgrade and Migration Guide
Upgrading to the latest version of Ansible Automation Platform and migrating legacy virtual environments to automation execution environments
Abstract
Chapter 1. Upgrading to Red Hat Ansible Automation Platform Copy linkLink copied to clipboard!
Automation hub acts as a content provider for automation controller, which requires both an automation controller deployment and an automation hub deployment running alongside each other. The Red Hat Ansible Automation Platform installer contains both of these. This section covers each component of the upgrading process:
- Upgrade planning
- Obtaining the installer
- Setting up the inventory file
- Running the setup playbook
- Migrating from virtual environments to automation execution environments
All upgrades should be no more than two major versions behind what you are currently upgrading to. For example, in order to upgrade to automation controller 4.0, you must first be on version 3.8.x. There is no direct upgrade path from version 3.7.x or earlier. Refer to the article, Recommended upgrade path on the Red Hat customer portal for more information.
In order to run automation controller 4.0, you must also have Ansible 2.10.
1.1. Upgrade planning Copy linkLink copied to clipboard!
This section covers changes that you should keep in mind as you attempt to upgrade your automation controller instance
- Even if you already have a valid license from a previous version, you must still provide your credentials or a subscriptions manifest again upon upgrading to automation controller 3.8. See Import a subscription in the Automation Controller User Guide.
- If you need to upgrade Red Hat Enterprise Linux and automation controller, you will need to do a backup and restore of your automation controller data. Refer to Upgrading an Existing Controller Installation for further detail.
- Clustered upgrades require special attention to instance and instance groups prior to starting the upgrade. Refer to the Setting up the inventory file and see Clustering for details.
-
Prior versions of Ansible Tower used the variable name
rabbitmq_hostduring installation. If you are upgrading from a previous version of Tower, and you previously specifiedrabbitmq_hostin your inventory, simply renamerabbitmq_hosttoroutable_hostnamebefore upgrading. See Clustering for details.
1.2. Choosing and obtaining a Red Hat Ansible Automation Platform installer Copy linkLink copied to clipboard!
Choose the Red Hat Ansible Automation Platform installer you need based on your Red Hat Enterprise Linux environment internet connectivity. Review the scenarios below and determine which Red Hat Ansible Automation Platform installer meets your needs.
A valid Red Hat customer account is required to access Red Hat Ansible Automation Platform installer downloads on the Red Hat Customer Portal.
Installing with internet access
Choose the Red Hat Ansible Automation Platform installer if your Red Hat Enterprise Linux environment is connected to the internet. Installing with internet access will retrieve the latest required repositories, packages, and dependencies.
- Navigate to https://access.redhat.com/downloads/content/480
- Click Download Now for the Ansible Automation Platform <latest-version> Setup.
Extract the files:
$ tar xvzf ansible-automation-platform-setup-<latest-version>.tar.gz
Installing without internet access
Use the Red Hat Ansible Automation Platform Bundle installer if you are unable to access the internet, or would prefer not to install separate components and dependencies from online repositories. Access to Red Hat Enterprise Linux repositories is still needed. All other dependencies are included in the tar archive.
- Navigate to https://access.redhat.com/downloads/content/480
- Click Download Now for the Ansible Automation Platform <latest-version> Setup Bundle.
Extract the files:
$ tar xvzf ansible-automation-platform-setup-bundle-<latest-version>.tar.gz
1.3. Role-Based Access Controls Copy linkLink copied to clipboard!
Ansible Tower 3.7 contains minor updates to the Role-Based Access Control (RBAC) system. For the latest RBAC documentation, refer to the Role-Based Access Controls section in the Automation Controller User Guide.
Organization field on Job Templates
Job templates in automation controller now include an organization field in the API. This is set on creation based on the organization of the project used by the Job Template, and cannot be changed. Because of this, a project’s organization cannot be changed once it is in use by Job Templates.
This changes visibility and access to job templates. Previously, an admin of the organization that a job template’s inventory belonged to would also be granted admin access to the job template. While existing permissions are preserved on an upgrade to Ansible Tower 3.7, newly created jobs will only grant view access to the job template to the inventory admin in this scenario.
Chapter 2. Upgrading to automation execution environments Copy linkLink copied to clipboard!
If upgrading from older versions of automation controller to 4.0 or later, the controller has the ability to detect previous versions of virtual environments associated with Organizations, Inventory, and Job Templates; and inform you that you will need to migrate to the new automation execution environments model. A brand new installation of automation controller creates two virtualenvs during installation—one is used to run the controller itself, while the other is used to run Ansible. Like legacy virtual environments, automation execution environments allow the controller to run in a stable environment, while allowing you to add or update modules to your automation execution environments as necessary to run your playbooks.
Migrate legacy venvs to automation execution environments
You can have the exact same setup in an automation execution environment that you had in a prior custom virtual environment by migrating them to the new automation execution environment. Use the awx-manage commands in this section to:
-
list of all the current custom virtual environments and their paths (
list_custom_venvs) -
view the resources that rely a particular custom virtual environment (
custom_venv_associations) -
export a particular custom virtual environment to a format that can be used to migrate to an automation execution environment (
export_custom_venv)
The below workflow describes how to migrate from legacy venvs to automation execution environments using the awx-manage command.
2.1. Migrating virtual envs to automation execution environments Copy linkLink copied to clipboard!
Use the following sections to assist with additional steps in the migration process once you have upgraded to Red Hat Ansible Automation Platform 2.0 and automation controller 4.0.
2.1.1. Listing custom virtual environments Copy linkLink copied to clipboard!
You can list the virtual environments on your automation controller instance using the awx-manage command.
Procedure
SSH into your automation controller instance and run:
$ awx-manage list_custom_venvs
A list of discovered virtual environments will appear.
# Discovered virtual environments:
/var/lib/awx/venv/testing
/var/lib/venv/new_env
To export the contents of a virtual environment, re-run while supplying the path as an argument:
awx-manage export_custom_venv /path/to/venv
2.1.2. Viewing objects associated with a custom virtual environment Copy linkLink copied to clipboard!
View the organizations, jobs, and inventory sources associated with a custom virtual environment using the awx-manage command.
Procedure
SSH into your automation controller instance and run:
$ awx-manage custom_venv_associations /path/to/venv
A list of associated objects will appear.
inventory_sources:
- id: 15
name: celery
job_templates:
- id: 9
name: Demo Job Template @ 2:40:47 PM
- id: 13
name: elephant
organizations
- id: 3
name: alternating_bongo_meow
- id: 1
name: Default
projects: []
2.1.3. Selecing the custom virtual environment to export Copy linkLink copied to clipboard!
Select the custom virtual environment you wish to export using awx-manage export_custom_venv command.
Procedure
SSH into your automation controller instance and run:
$ awx-manage export_custom_venv /path/to/venv
The output from this command will show a pip freeze of what is in the specified virtual environment. This information can be copied into a requirements.txt file for Ansible Builder to use for creating a new automation execution environments image
numpy==1.20.2
pandas==1.2.4
python-dateutil==2.8.1
pytz==2021.1
six==1.16.0
To list all available custom virtual environments run:
awx-manage list_custom_venvs
Pass the -q flag when running `awx-manage list_custom_venvs`to reduce output.