Chapter 7. Maintaining containerized Ansible Automation Platform
Update, backup, restore, uninstall, or reinstall containerized Ansible Automation Platform deployments to support your automation infrastructure.
7.1. Upgrading containerized Ansible Automation Platform Copy linkLink copied to clipboard!
Perform an upgrade of containerized Ansible Automation Platform.
Prerequisites
- You have reviewed the release notes for the associated patch release. For more information, see Ansible Automation Platform Release notes.
- You have a backup of your Ansible Automation Platform deployment. For more information, see Backing up container-based Ansible Automation Platform.
Procedure
- Log in to the Red Hat Enterprise Linux host as your dedicated non-root user.
- Follow the steps in Downloading Ansible Automation Platform to download the latest version of containerized Ansible Automation Platform.
- Copy the downloaded installation program to your Red Hat Enterprise Linux Host.
-
Edit the
inventoryfile to match your required configuration. You can keep the same parameters from your existing Ansible Automation Platform deployment or you can change the parameters to match any modifications to your environment. Run the
installplaybook:ansible-playbook -i inventory ansible.containerized_installer.install
$ ansible-playbook -i inventory ansible.containerized_installer.installCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
If your privilege escalation requires a password to be entered, append
-Kto the command. You will then be prompted for theBECOMEpassword. -
You can use increasing verbosity, up to 4 v’s (
-vvvv) to see the details of the installation process. However it is important to note that this can significantly increase installation time, so it is recommended that you use it only as needed or requested by Red Hat support.
-
If your privilege escalation requires a password to be entered, append
7.2. Backing up containerized Ansible Automation Platform Copy linkLink copied to clipboard!
Perform a backup of your container-based installation of Ansible Automation Platform.
- When backing up Ansible Automation Platform, use the installation program that matches your currently installed version of Ansible Automation Platform.
- Backup functionality only works with the PostgreSQL versions supported by your current Ansible Automation Platform version. For more information, see System requirements.
- Backup and restore for content stored in Azure Blob Storage or Amazon S3 must be handled through the vendor portals, as each vendor provides their own backup solutions.
Prerequisites
- You have logged in to the Red Hat Enterprise Linux host as your dedicated non-root user.
Procedure
- Go to the Red Hat Ansible Automation Platform installation directory on your Red Hat Enterprise Linux host.
To control compression of the backup artifacts before they are sent to the host running the backup operation, you can use the following variables in your inventory file:
For control of compression for filesystem related backup files:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For control of compression for database related backup files:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Run the
backupplaybook:ansible-playbook -i <path_to_inventory> ansible.containerized_installer.backup
$ ansible-playbook -i <path_to_inventory> ansible.containerized_installer.backupCopy to Clipboard Copied! Toggle word wrap Toggle overflow The backup process creates archives of the following data:
- PostgreSQL databases
- Configuration files
- Data files
Next steps
To customize the backup process, you can use the following variables in your inventory file:
-
Change the backup destination directory from the default
./backupsby using thebackup_dirvariable. Exclude paths that contain duplicated data, such as snapshot subdirectories, by using the
hub_data_path_excludevariable. For example, to exclude a.snapshotssubdirectory, specifyhub_data_path_exclude=['/.snapshots/']in your inventory file.Alternatively, you can use the command-line interface with the
-eflag to pass this variable at runtime:ansible-playbook -i inventory ansible.containerized_installer.backup -e hub_data_path_exclude="['*/.snapshots/*']"
$ ansible-playbook -i inventory ansible.containerized_installer.backup -e hub_data_path_exclude="['*/.snapshots/*']"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.3. Restoring containerized Ansible Automation Platform Copy linkLink copied to clipboard!
Restore your container-based installation of Ansible Automation Platform from a backup, or to a different environment.
When restoring Ansible Automation Platform, use the latest installation program available at the time of the restore. For example, if you are restoring a backup taken from version 2.6-1, use the latest 2.6-x installation program available at the time of the restore.
Restore functionality only works with the PostgreSQL versions supported by your current Ansible Automation Platform version. For more information, see System requirements.
Prerequisites
- You have logged in to the Red Hat Enterprise Linux host as your dedicated non-root user.
- You have a backup of your Ansible Automation Platform deployment. For more information, see Backing up container-based Ansible Automation Platform.
- If restoring to a different environment with the same hostnames, you have performed a fresh installation on the target environment with the same topology as the original (source) environment.
- You have ensured that the administrator credentials on the target environment match the administrator credentials from the source environment.
Procedure
- Go to the installation directory on your Red Hat Enterprise Linux host.
Perform the relevant restoration steps:
If you are restoring to the same environment with the same hostnames, run the
restoreplaybook:ansible-playbook -i <path_to_inventory> ansible.containerized_installer.restore
$ ansible-playbook -i <path_to_inventory> ansible.containerized_installer.restoreCopy to Clipboard Copied! Toggle word wrap Toggle overflow This restores the important data deployed by the containerized installer such as:
- PostgreSQL databases
- Configuration files
Data files
By default, the backup directory is set to
./backups. You can change this by using thebackup_dirvariable in yourinventoryfile.
If you are restoring to a different environment with different hostnames, perform the following additional steps before running the
restoreplaybook:ImportantRestoring to a different environment with different hostnames is not recommended and is intended only as a workaround.
For each component, identify the backup file from the source environment that contains the PostgreSQL dump file.
For example:
cd ansible-automation-platform-containerized-setup-<version_number>/backups
$ cd ansible-automation-platform-containerized-setup-<version_number>/backupsCopy to Clipboard Copied! Toggle word wrap Toggle overflow tar tvf gateway_env1-gateway-node1.tar.gz | grep db
$ tar tvf gateway_env1-gateway-node1.tar.gz | grep db -rw-r--r-- ansible/ansible 4850774 2025-06-30 11:05 aap/backups/awx.dbCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the backup files from the source environment to the target environment.
Rename the backup files on the target environment to reflect the new node names.
For example:
cd ansible-automation-platform-containerized-setup-<version_number>/backups
$ cd ansible-automation-platform-containerized-setup-<version_number>/backupsCopy to Clipboard Copied! Toggle word wrap Toggle overflow mv gateway_env1-gateway-node1.tar.gz gateway_env2-gateway-node1.tar.gz
$ mv gateway_env1-gateway-node1.tar.gz gateway_env2-gateway-node1.tar.gzCopy to Clipboard Copied! Toggle word wrap Toggle overflow For enterprise topologies, ensure that the component backup file containing the
component.dbfile is listed first in its group within the inventory file.For example:
cd ansible-automation-platform-containerized-setup-<version_number>
$ cd ansible-automation-platform-containerized-setup-<version_number>Copy to Clipboard Copied! Toggle word wrap Toggle overflow ls backups/gateway*
$ ls backups/gateway* gateway_env2-gateway-node1.tar.gz gateway_env2-gateway-node2.tar.gzCopy to Clipboard Copied! Toggle word wrap Toggle overflow tar tvf backups/gateway_env2-gateway-node1.tar.gz | grep db
$ tar tvf backups/gateway_env2-gateway-node1.tar.gz | grep db -rw-r--r-- ansible/ansible 416687 2025-06-30 11:05 aap/backups/gateway.dbCopy to Clipboard Copied! Toggle word wrap Toggle overflow tar tvf backups/gateway_env2-gateway-node2.tar.gz | grep db
$ tar tvf backups/gateway_env2-gateway-node2.tar.gz | grep dbCopy to Clipboard Copied! Toggle word wrap Toggle overflow vi inventory
$ vi inventory [automationgateway] env2-gateway-node1 env2-gateway-node2Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.4. Uninstalling containerized Ansible Automation Platform Copy linkLink copied to clipboard!
Uninstall your container-based installation of Ansible Automation Platform.
Prerequisites
- You have logged in to the Red Hat Enterprise Linux host as your dedicated non-root user.
Procedure
If you intend to reinstall Ansible Automation Platform and want to use the preserved databases, you must collect the existing secret keys:
First, list the available secrets:
podman secret list
$ podman secret listCopy to Clipboard Copied! Toggle word wrap Toggle overflow Next, collect the secret keys by running the following command:
podman secret inspect --showsecret <secret_key_variable> | jq -r .[].SecretData
$ podman secret inspect --showsecret <secret_key_variable> | jq -r .[].SecretDataCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
podman secret inspect --showsecret controller_secret_key | jq -r .[].SecretData
$ podman secret inspect --showsecret controller_secret_key | jq -r .[].SecretDataCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Run the
uninstallplaybook:ansible-playbook -i inventory ansible.containerized_installer.uninstall
$ ansible-playbook -i inventory ansible.containerized_installer.uninstallCopy to Clipboard Copied! Toggle word wrap Toggle overflow This stops all systemd units and containers and then deletes all resources used by the containerized installer such as:
- configuration and data directories and files
- systemd unit files
- Podman containers and images
- RPM packages
To keep container images, set the
container_keep_imagesparameter totrue.ansible-playbook -i inventory ansible.containerized_installer.uninstall -e container_keep_images=true
$ ansible-playbook -i inventory ansible.containerized_installer.uninstall -e container_keep_images=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow To keep PostgreSQL databases, set the
postgresql_keep_databasesparameter totrue.ansible-playbook -i inventory ansible.containerized_installer.uninstall -e postgresql_keep_databases=true
$ ansible-playbook -i inventory ansible.containerized_installer.uninstall -e postgresql_keep_databases=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow
7.5. Reinstalling containerized Ansible Automation Platform Copy linkLink copied to clipboard!
To reinstall a containerized deployment after uninstalling and preserving the database, follow the steps in Installing containerized Ansible Automation Platform and include the existing secret key value in the playbook command:
ansible-playbook -i inventory ansible.containerized_installer.install -e controller_secret_key=<secret_key_value>
$ ansible-playbook -i inventory ansible.containerized_installer.install -e controller_secret_key=<secret_key_value>