Chapter 7. Migrating existing content Use the following sections learn how to use the awx-manage command 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. Additionally, learn more about migrating between versions of Ansible. 7.1. Migrating virtual envs to automation execution environments 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. 7.1.1. Listing custom virtual environments 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: USD 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 7.1.2. Viewing objects associated with a custom virtual environment 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: USD 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: [] 7.1.3. Selecting the custom virtual environment to export Select the custom virtual environment you want to export by using awx-manage export_custom_venv command. Procedure SSH into your automation controller instance and run: USD 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 Note Pass the -q flag when running awx-manage list_custom_venvs to reduce output. 7.2. Migrating between Ansible Core versions Migrating between versions of Ansible Core requires you to update your playbooks, plugins and other parts of your Ansible infrastructure to ensure they work with the latest version. This process requires that changes are validated against the updates made to each successive version of Ansible Core. If you intend to migrate from earlier versions of Ansible to Ansible-core 2.15, you first need to verify that you meet the requirements of the Ansible version that follows your version, and from there make successive updates to 2.15. 7.2.1. Ansible Porting Guides The Ansible Porting Guide is a series of documents that provide information on the behavioral changes between consecutive Ansible versions. Refer to the guides when migrating from version of Ansible to a newer version. 7.2.2. Additional resources Refer to the Ansible 2.9 for behavior changes between Ansible 2.8 and Ansible 2.9. Refer to the Ansible 2.10 for behavior changes between Ansible 2.9 and Ansible 2.10.

Commands:
awx-manage list_custom_venvs
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
awx-manage custom_venv_associations /path/to/venv
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: []
awx-manage export_custom_venv /path/to/venv
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