Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 3. Backup and restore Ansible Automation Platform


You can protect your Ansible Automation Platform environment by backing up the database, configuration files, and keys. Use the ./setup.sh script or playbooks to create compressed artifacts. This ensures a recovery path for single nodes or clusters, including restores, to secondary instances.

Note

Use the installation program matching your current Ansible Automation Platform version for backups, and always use the latest available version for restores. Ensure your PostgreSQL version is supported by checking the System requirements in Planning your installation.

3.1. Backup and restoration considerations

Consider the following points when you backup and restore your system:

Disk space

Review your disk space requirements to ensure you have enough room to backup configuration files, keys, other relevant files, and the database of the Ansible Automation Platform installation.

Note

The Ansible Automation Platform database backups are staged on each node at /var/backups/automation-platform through the variable backup_dir. You might need to mount a new volume to /var/backups or change the staging location with the variable backup_dir to prevent issues with disk space before running the ./setup.sh -b script.

System credentials
Confirm you have the required system credentials when working with a local database or a remote database. On local systems, you might need root or sudo access, depending on how credentials are set up. On remote systems, you might need different credentials to grant you access to the remote system you are trying to backup or restore.
Version
You must always use the most recent minor version of a release to backup or restore your Ansible Automation Platform installation version. For example, if the current platform version you are on is 2.6.x, only use the latest 2.6 installer.
Backup file location
  • Default location: If the backup file is placed in the same directory as the ./setup.sh installer, the restore playbook locates it automatically.
  • Non-default location: If your backup file is stored in a different directory, you must specify the path using the restore_backup_file extra variable when running the restore command.

3.2. Back up the Ansible Automation Platform

Back up your instance using the setup.sh script to save your environment content and configuration. Use the optional backup_dest flag only to change the default save location. Apply compression flags to reduce artifact size before transmission.

3.2.1. Backup playbook

The Ansible Automation Platform installer (install.yml) includes the backup.yml playbook, which automates the backup and restoration of your environment. You can use this playbook to capture critical configuration data and databases for the following components:

  • Platform gateway:

    • The database
    • The SECRET_KEY file
  • Automation controller:

    • The database
    • The SECRET_KEY file
    • The RESOURCE_SERVER` key
    • The per-host custom configuration files
  • Automation hub:

    • The database
    • The database_fields.symmetric.key file
    • The SECRET_KEY` file
    • The RESOURCE_SERVER key
    • Automation hub pulp content
  • Event-Driven Ansible controller:

    • The database
    • The SECRET_KEY file
    • The RESOURCE_SERVER key

3.2.2. Back up the platform using automation installer

Run the setup script to create a verified archive of your platform database, configurations, and secrets. This ensures your instance is captured in a compatible format for reliable restoration during a system failure or migration.

Procedure

  1. Navigate to your Ansible Automation Platform installation directory.
  2. Run the ./setup.sh script following the example below:

    $ ./setup.sh -e 'backup_dest=/ansible/mybackup' -e
    'use_archive_compression=true' 'use_db_compression=true @credentials.yml -b
    Copy to Clipboard Toggle word wrap

    Where:

    • backup_dest: Specifies a directory to save your backup to.
    • backup_dir: Specifies the directory used on the host staging backup files before they are transferred to backup_dest locally.
    • use_archive_compression=true and use_db_compression=true: Compresses the backup artifacts before they are sent to the host running the backup operation.

      You can use the following variables to customize the compression:

      • For global control of compression for filesystem related backup files: use_archive_compression=true
      • For component-level control of compression for filesystem related backup files: <componentName>_use_archive_compression
      • For global control of compression for database related backup files: use_db_compression=true
      • For component-level control of compression for database related backup files: <componentName>_use_db_compression=true

Result

After a successful backup, a backup file is created at /ansible/mybackup/automation-platform-backup-<date/time>.tar.gz.

3.3. Restore Ansible Automation Platform

Restoring your instance using the setup.sh script helps you safely reinstate your environment content and configuration. Use the optional restore_backup_file flag only to change the TAR file location.

3.3.1. Restore playbook

Automation controller includes playbooks to backup and restore your installation.

In addition to the install.yml file included with your setup.sh setup playbook, there are also restore.yml files.

The restore backup restores the backed up files and data to a freshly installed and working second instance of automation controller.

When restoring your system, installation program checks to see that the backup file exists before beginning the restoration. If the backup file is not available, your restoration fails.

Note

Make sure that your automation controller hosts are properly set up with SSH keys, user or pass variables in the hosts file, and that the user has sudo access.

3.3.2. Restore the platform to its original state

Restore your environment by running the setup.sh script to recover platform data and configurations. Ensure the backup TAR file is available in the default location, or use the optional restore_backup_file flag to specify a custom path before starting.

Procedure

  1. Navigate to your Ansible Automation Platform installation directory.
  2. Run the ./setup.sh script following the example:

    root@localhost:~# ./setup.sh -e 'restore_backup_file=/path/to/nondefault/backup.tar.gz' -r
    Copy to Clipboard Toggle word wrap

    Where: restore_backup_file: Path to the TAR file used for the platform restore.

Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2026 Red Hat
Retour au début