Red Hat Ansible Automation Platform-2.1-Red Hat Ansible Automation Platform Upgrade and Migration Guide-en-US
Red Hat Ansible Automation Platform-2.1-Red Hat Ansible Automation Platform Upgrade and Migration Guide-en-US
2.1
Upgrading to the latest version of Ansible Automation Platform and migrating legacy
virtual environments to automation execution environments
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons
Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is
available at
http://creativecommons.org/licenses/by-sa/3.0/
. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must
provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert,
Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift,
Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States
and other countries.
Linux ® is the registered trademark of Linus Torvalds in the United States and other countries.
XFS ® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States
and/or other countries.
MySQL ® is a registered trademark of MySQL AB in the United States, the European Union and
other countries.
Node.js ® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the
official Joyent Node.js open source or commercial project.
The OpenStack ® Word Mark and OpenStack logo are either registered trademarks/service marks
or trademarks/service marks of the OpenStack Foundation, in the United States and other
countries and are used with the OpenStack Foundation's permission. We are not affiliated with,
endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
Abstract
Providing Feedback: If you have a suggestion to improve this documentation, or find an error,
please contact technical support at to create an issue on the Ansible Automation Platform Jira
project using the Docs component.
Table of Contents
Table of Contents
. . . . . . . . . .OPEN
MAKING . . . . . . SOURCE
. . . . . . . . . .MORE
. . . . . . .INCLUSIVE
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3. . . . . . . . . . . . .
.CHAPTER
. . . . . . . . . . 1.. .UPGRADING
. . . . . . . . . . . . . .ISOLATED
. . . . . . . . . . .NODES
. . . . . . . .TO
. . . .EXECUTION
. . . . . . . . . . . . .NODES
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4. . . . . . . . . . . . .
1.1. PREREQUISITES FOR UPGRADING ANSIBLE AUTOMATION PLATFORM 4
1.1.1. Node requirements 4
1.1.2. Automation controller configuration requirements 5
1.1.3. Ansible Automation Platform configuration requirements 7
1.2. BACK UP YOUR ANSIBLE AUTOMATION PLATFORM INSTANCE 7
1.3. DEPLOY A NEW INSTANCE FOR A SIDE-BY-SIDE UPGRADE 8
1.3.1. Deploy a new instance of Ansible Tower 8
1.3.2. Recreate instance groups in the new instance 8
1.4. RESTORE BACKUP TO NEW INSTANCE 9
1.5. UPGRADING TO ANSIBLE AUTOMATION PLATFORM 2.1 9
1.6. CONFIGURING YOUR UPGRADED ANSIBLE AUTOMATION PLATFORM 11
1.6.1. Configuring automation controller instance groups 11
.CHAPTER
. . . . . . . . . . 2.
. . MIGRATING
. . . . . . . . . . . . . TO
. . . .AUTOMATION
. . . . . . . . . . . . . . . EXECUTION
. . . . . . . . . . . . . ENVIRONMENTS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
..............
2.1. WHY UPGRADE TO AUTOMATION EXECUTION ENVIRONMENTS? 12
2.2. ABOUT MIGRATING LEGACY VENVS TO AUTOMATION EXECUTION ENVIRONMENTS 12
2.3. MIGRATING VIRTUAL ENVS TO AUTOMATION EXECUTION ENVIRONMENTS 13
2.3.1. Listing custom virtual environments 13
2.3.2. Viewing objects associated with a custom virtual environment 13
2.3.3. Selecting the custom virtual environment to export 14
2.4. ADDITIONAL RESOURCES 14
. . . . . . . . . . . 3.
CHAPTER . . ANSIBLE
. . . . . . . . . . CONTENT
. . . . . . . . . . . MIGRATION
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
..............
3.1. MIGRATING YOUR ANSIBLE PLAYBOOKS AND ROLES TO CORE 2.12 15
1
Red Hat Ansible Automation Platform 2.1 Red Hat Ansible Automation Platform Upgrade and Migration Guide
2
MAKING OPEN SOURCE MORE INCLUSIVE
3
Red Hat Ansible Automation Platform 2.1 Red Hat Ansible Automation Platform Upgrade and Migration Guide
This guide explains how to perform a side-by-side migration. This ensures that the data on your original
automation environment remains untouched during the migration process.
6. Set up execution nodes and upgrade instance to Red Hat Ansible Automation Platform 2.1.
16 GB of RAM for controller nodes, database node, execution nodes and hop nodes.
4 CPUs for controller nodes, database nodes, execution nodes, and hop nodes.
DHCP reservations use infinite leases to deploy the cluster with static IP addresses.
Red Hat Enterprise Linux 8 or later 64-bit (x86) installed for all nodes.
4
CHAPTER 1. UPGRADING ISOLATED NODES TO EXECUTION NODES
Each Ansible Automation Platform node in the cluster must have access to an NTP server. Use the
chronyd to synchronize the system clock with NTP servers. This ensures that cluster nodes using SSL
certificates that require validation do not fail if the date and time between nodes are not in sync.
This is required for all nodes used in the upgraded Ansible Automation Platform cluster:
1. Install chrony:
3. Locate the public server pool section and modify it to include the appropriate NTP server
addresses. Only one server is required, but three are recommended. Add the iburst option to
speed up the time it takes to properly sync with the servers:
Red Hat Ansible Automation Platform requires you to have valid subscriptions attached to all nodes. You
can verify that your current node has a Red Hat subscription by running the following command:
If there is not a Red Hat subscription attached to the node, see attaching your Ansible Automation
Platform subscription for more information.
Before you upgrade Ansible Automation Platform, it is recommended to create a non-root user with
sudo privileges for the deployment process. This user is used for:
SSH connectivity.
5
Red Hat Ansible Automation Platform 2.1 Red Hat Ansible Automation Platform Upgrade and Migration Guide
The following example uses ansible to name this user. On all nodes used in the upgraded Ansible
Automation Platform cluster, create a non-root user named ansible and generate an ssh key:
# useradd ansible
# passwd ansible 1
Changing password for ansible.
Old Password:
New Password:
Retype New Password:
1 Replace ansible with the non-root user from step 1, if using a different name
$ ssh-keygen -t rsa
With the ansible user created, copy the ssh key to all the nodes used in the upgraded Ansible
Automation Platform cluster. This ensures that when the Ansible Automation Platform installation runs,
it can ssh to all the nodes without a password:
$ ssh-copy-id [email protected]
NOTE
Configure the firewall settings on all the nodes used in the upgraded Ansible Automation Platform
cluster to permit access to the appropriate services and ports for a successful Ansible Automation
Platform upgrade. For Red Hat Enterprise Linux 8 or later, enable the firewalld daemon to enable the
access needed for all nodes:
6
CHAPTER 1. UPGRADING ISOLATED NODES TO EXECUTION NODES
After upgrading your Red Hat Ansible Automation Platform instance, add the automation mesh port on
the mesh nodes (execution and hop nodes) to enable automation mesh functionality. The default port
used for the mesh networks on all nodes is 27199/tcp. You can configure the mesh network to use a
different port by specifying recptor_listener_port as the variable for each node within your inventory
file.
Within your hop and execution node set the firewalld port to be used for installation.
2. Add the firewalld port to your controller database node (e.g. port 27199):
3. Reload firewalld:
7
Red Hat Ansible Automation Platform 2.1 Red Hat Ansible Automation Platform Upgrade and Migration Guide
2 @credentials.yml passes the password variables and their values encrypted via ansible-
vault.
This backup will be necessary later to migrate content from your old instance to the new one.
1. Download the Tower installer version that matches your original Tower instance by navigating to
the Ansible Tower installer page .
2. Navigate to the installer, then open the inventory file using a text editor to configure the
inventory file for a Tower installation:
NOTE
For more information about installing Tower using the Ansible Automation
Platform installer, see the Ansible Automation Platform Installation Guide for
your specific installation scenario.
Once the new instance is installed, configure the Tower settings to match the instance groups from your
original Tower instance.
NOTE
Make note of all instance groups from your original Tower instance. You will need to
recreate these groups in your new instance.
8
CHAPTER 1. UPGRADING ISOLATED NODES TO EXECUTION NODES
4. Enter a Name that matches an instance group from your original instance, then click Save
5. Repeat until all instance groups from your original instance have been recreated.
Procedure
$ ./setup.sh -r -e ‘restore_backup_file=/ansible/mybackup/tower-backup-latest.tar.gz’ -e
‘use_compression=True’ -e @credentials.yml -r -- --ask-vault-pass 1 2 3
2 use_compression is set to True due to compression being used during the backup
process
2. Log in to your new RHEL 8 Tower 3.8 instance to verify whether the content from your original
instance has been restored:
a. Navigate to Administration → Instance groups. The recreated instance groups should now
contain the Total Jobs from your original instance.
b. Using the side navigation panel, check that your content has been imported from your
original instance, including Jobs, Templates, Inventories, Credentials, and Users.
You now have a new instance of Ansible Tower with all the Ansible content from your original instance.
You will upgrade this new instance to Ansible Automation Platform 2.1 so that you keep all your previous
data without overwriting your original instance.
1. Download the latest installer for Red Hat Ansible Automation Platform from the Red Hat
Customer Portal.
9
Red Hat Ansible Automation Platform 2.1 Red Hat Ansible Automation Platform Upgrade and Migration Guide
$ cd ansible-automation-platform-setup-<latest-version>/
4. Copy the inventory file from your original instance into the directory of the latest installer:
$ cp ansible-tower-setup-3.8.x.x/inventory ansible-automation-platform-setup-<latest-
version>
$ ./setup.sh
The setup script pauses and indicates that a "pre-2.x" inventory file was detected, but offers a
new file called inventory.new.ini allowing you to continue to upgrade your original instance.
NOTE
By running the setup script, the Installer modified a few fields from your original
inventory file, such as renaming [tower] to [automationcontroller].
7. Modify the newly generated inventory.new.ini file to configure your automation mesh by
assigning relevant variables, nodes, and relevant node-to-node peer connections:
NOTE
The design of your automation mesh topology depends on the automation needs
of your environment. The example below offers one possible scenario for
automation mesh design, and the design of your automation mesh topology
depends on the automation needs of your environment. Review the full Ansible
Automation Platform automation mesh guide for information on designing it for
your needs.
Example inventory file with a standard control plane consisting of three nodes utilizing hop
nodes:
[automationcontroller]
control-plane-1.example.com
control-plane-2.example.com
control-plane-3.example.com
[automationcontroller:vars]
node_type=control 1
peers=execution_nodes 2
[execution_nodes]
execution-node-1.example.com peers=execution-node-2.example.com
execution-node-2.example.com peers=execution-node-3.example.com
execution-node-3.example.com peers=execution-node-4.example.com
execution-node-4.example.com peers=execution-node-5.example.com node_type=hop
10
CHAPTER 1. UPGRADING ISOLATED NODES TO EXECUTION NODES
[execution_nodes:vars]
node_type=execution
1 Specifies a control node that runs project and inventory updates and system jobs, but not
regular jobs. Execution capabilities are disabled on these nodes.
3 Specifies hop nodes that route traffic to other execution nodes. Hop nodes cannot
execute automation.
8. Once you have finished configuring your inventory.new.ini for automation mesh, run the setup
script using inventory.new.ini:
9. Once the installation completes, verify that your Ansible Automation Platform has been installed
successfully by logging in to the Ansible Automation Platform dashboard UI across all
automation controller nodes.
Additional resources
For general information on using the Ansible Automation Platform installer, see the Red Hat
Ansible Automation Platform installation guide.
For more information about automation mesh, see the Ansible Automation Platform automation
mesh guide
2. Content from the old instance, such as credentials, jobs, inventories should now be visible on
your Controller instance.
4. Associate execution nodes by clicking on an instance group, then click the Instances tab.
5. Click Associate. Select the node(s) to associate to this instance group, then click Save.
6. You can also modify the default instance to disassociate your new execution nodes.
11
Red Hat Ansible Automation Platform 2.1 Red Hat Ansible Automation Platform Upgrade and Migration Guide
RHEL UBI 8
By including these elements, Ansible provides platform administrators a standardized way to define,
build, and distribute the environments the automation runs in.
Due to the new automation execution environment, it is no longer necessary for administrators to create
custom plugins and automation content. Administrators can now spin up smaller automation execution
environments in less time to create their content.
All custom dependencies are now defined in the development phase instead of the administration and
deployment phase. Decoupling from the control plane enables faster development cycles, scalability,
reliability, and portability across environments. Automation execution environments enables the Ansible
Automation Platform to move to a distributed architecture allowing administrators to scale automation
across their organization.
You can duplicate your setup in an automation execution environment from a previous custom virtual
environment by migrating it 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)
export a particular custom virtual environment to a format that can be used to migrate to an
12
CHAPTER 2. MIGRATING TO AUTOMATION EXECUTION ENVIRONMENTS
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.
Procedure
$ awx-manage list_custom_venvs
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
Procedure
inventory_sources:
- id: 15
name: celery
job_templates:
- id: 9
name: Demo Job Template @ 2:40:47 PM
- id: 13
13
Red Hat Ansible Automation Platform 2.1 Red Hat Ansible Automation Platform Upgrade and Migration Guide
name: elephant
organizations
- id: 3
name: alternating_bongo_meow
- id: 1
name: Default
projects: []
Procedure
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
NOTE
14
CHAPTER 3. ANSIBLE CONTENT MIGRATION
For a list of fully supported and certified Ansible Content Collections, see Ansible Automation hub on
console.redhat.com.
If you are using ansible-core modules and are not calling a module from a different Collection, you
should use the FQCN ansible.builtin.copy.
15