Chapter 7. Maintaining containerized Ansible Automation Platform


Update, backup, restore, uninstall, or reinstall containerized Ansible Automation Platform deployments to support your automation infrastructure.

Perform an upgrade of containerized Ansible Automation Platform.

Prerequisites

Procedure

  1. Log in to the Red Hat Enterprise Linux host as your dedicated non-root user.
  2. Follow the steps in Downloading Ansible Automation Platform to download the latest version of containerized Ansible Automation Platform.
  3. Copy the downloaded installation program to your Red Hat Enterprise Linux Host.
  4. Edit the inventory file 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.
  5. Run the install playbook:

    $ ansible-playbook -i inventory ansible.containerized_installer.install
    Copy to Clipboard Toggle word wrap
    • If your privilege escalation requires a password to be entered, append -K to the command. You will then be prompted for the BECOME password.
    • 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.

Perform a backup of your container-based installation of Ansible Automation Platform.

Note
  • 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

  1. Go to the Red Hat Ansible Automation Platform installation directory on your Red Hat Enterprise Linux host.
  2. 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:

    1. For control of compression for filesystem related backup files:

      # Global control of compression for filesystem backup files
      use_archive_compression=true
      
      # Component-level control of compression for filesystem backup files
      #controller_use_archive_compression=true
      #eda_use_archive_compression=true
      #gateway_use_archive_compression=true
      #hub_use_archive_compression=true
      #pcp_use_archive_compression=true
      #postgresql_use_archive_compression=true
      #receptor_use_archive_compression=true
      #redis_use_archive_compression=true
      Copy to Clipboard Toggle word wrap
    2. For control of compression for database related backup files:

      # Global control of compression for database backup files
      use_db_compression=true
      
      # Component-level control of compression for database backup files
      #controller_use_db_compression=true
      #eda_use_db_compression=true
      #hub_use_db_compression=true
      #gateway_use_db_compression=true
      Copy to Clipboard Toggle word wrap
  3. Run the backup playbook:

    $ ansible-playbook -i <path_to_inventory> ansible.containerized_installer.backup
    Copy to Clipboard Toggle word wrap

    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 ./backups by using the backup_dir variable.
  • Exclude paths that contain duplicated data, such as snapshot subdirectories, by using the hub_data_path_exclude variable. For example, to exclude a .snapshots subdirectory, specify hub_data_path_exclude=['/.snapshots/'] in your inventory file.

    • Alternatively, you can use the command-line interface with the -e flag to pass this variable at runtime:

      $ ansible-playbook -i inventory ansible.containerized_installer.backup -e hub_data_path_exclude="['*/.snapshots/*']"
      Copy to Clipboard Toggle word wrap

Restore your container-based installation of Ansible Automation Platform from a backup, or to a different environment.

Note

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

  1. Go to the installation directory on your Red Hat Enterprise Linux host.
  2. Perform the relevant restoration steps:

    • If you are restoring to the same environment with the same hostnames, run the restore playbook:

      $ ansible-playbook -i <path_to_inventory> ansible.containerized_installer.restore
      Copy to Clipboard Toggle word wrap

      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 the backup_dir variable in your inventory file.

    • If you are restoring to a different environment with different hostnames, perform the following additional steps before running the restore playbook:

      Important

      Restoring to a different environment with different hostnames is not recommended and is intended only as a workaround.

      1. 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
        Copy to Clipboard Toggle word wrap
        $ tar tvf gateway_env1-gateway-node1.tar.gz | grep db
        
        -rw-r--r-- ansible/ansible 4850774 2025-06-30 11:05 aap/backups/awx.db
        Copy to Clipboard Toggle word wrap
      2. Copy the backup files from the source environment to the target environment.
      3. 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
        Copy to Clipboard Toggle word wrap
        $ mv gateway_env1-gateway-node1.tar.gz gateway_env2-gateway-node1.tar.gz
        Copy to Clipboard Toggle word wrap
      4. For enterprise topologies, ensure that the component backup file containing the component.db file is listed first in its group within the inventory file.

        For example:

        $ cd ansible-automation-platform-containerized-setup-<version_number>
        Copy to Clipboard Toggle word wrap
        $ ls backups/gateway*
        
        gateway_env2-gateway-node1.tar.gz
        gateway_env2-gateway-node2.tar.gz
        Copy to Clipboard Toggle word wrap
        $ 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.db
        Copy to Clipboard Toggle word wrap
        $ tar tvf backups/gateway_env2-gateway-node2.tar.gz | grep db
        Copy to Clipboard Toggle word wrap
        $ vi inventory
        
        [automationgateway]
        env2-gateway-node1
        env2-gateway-node2
        Copy to Clipboard Toggle word wrap

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

  1. If you intend to reinstall Ansible Automation Platform and want to use the preserved databases, you must collect the existing secret keys:

    1. First, list the available secrets:

      $ podman secret list
      Copy to Clipboard Toggle word wrap
    2. Next, collect the secret keys by running the following command:

      $ podman secret inspect --showsecret <secret_key_variable> | jq -r .[].SecretData
      Copy to Clipboard Toggle word wrap

      For example:

      $ podman secret inspect --showsecret controller_secret_key | jq -r .[].SecretData
      Copy to Clipboard Toggle word wrap
  2. Run the uninstall playbook:

    $ ansible-playbook -i inventory ansible.containerized_installer.uninstall
    Copy to Clipboard Toggle word wrap
    • 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_images parameter to true.

      $ ansible-playbook -i inventory ansible.containerized_installer.uninstall -e container_keep_images=true
      Copy to Clipboard Toggle word wrap
    • To keep PostgreSQL databases, set the postgresql_keep_databases parameter to true.

      $ ansible-playbook -i inventory ansible.containerized_installer.uninstall -e postgresql_keep_databases=true
      Copy to Clipboard Toggle word wrap

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>
Copy to Clipboard Toggle word wrap
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat