Chapter 2. Creating Red Hat Ansible Automation Platform backup resources Backing up your Red Hat Ansible Automation Platform deployment involves creating backup resources for your deployed instances. Use the following procedures to create backup resources for your Red Hat Ansible Automation Platform deployment. We recommend taking backups before upgrading the Ansible Automation Platform Operator. Take a backup regularly in case you want to restore the platform to a state. 2.1. Backing up the Automation controller deployment Use this procedure to back up a deployment of the controller, including jobs, inventories, and credentials. Prerequisites You must be authenticated with an OpenShift cluster. You have installed Ansible Automation Platform Operator on the cluster. You have deployed automation controller using the Ansible Automation Platform Operator. Procedure Log in to Red Hat OpenShift Container Platform . Navigate to Operators Installed Operators . Select your Ansible Automation Platform Operator deployment. Select the Automation Controller Backup tab. Click Create AutomationControllerBackup . Enter a Name for the backup. In the Deployment name field, enter the name of the AutomationController custom resource object of the deployed Ansible Automation Platform instance being backed up. This name was created when you created your AutomationController object . If you want to use a custom, pre-created pvc: Optionally enter the name of the Backup persistant volume claim . Optionally enter the Backup PVC storage requirements , and Backup PVC storage class . Note If no pvc or storage class is provided, the cluster's default storage class is used to create the pvc. If you have a large database, specify your storage requests accordingly under Backup management pod resource requirements . Note You can check the size of the existing postgres database data directory by running the following command inside the postgres pod. USD df -h | grep "/var/lib/pgsql/data" Click Create . A backup tarball of the specified deployment is created and available for data recovery or deployment rollback. Future backups are stored in separate tar files on the same pvc. Verification Log in to Red Hat Red Hat OpenShift Container Platform Navigate to Operators Installed Operators . Select your Ansible Automation Platform Operator. Select the AutomationControllerBackup tab. Select the backup resource you want to verify. Scroll to Conditions and check that the Successful status is True . Note If the status is Failure , the backup has failed. Check the automation controller operator logs for the error to fix the issue. 2.2. Using YAML to back up the Automation controller deployment See the following procedure for how to back up a deployment of the automation controller using YAML. Prerequisites You must be authenticated with an OpenShift cluster. You have installed Ansible Automation Platform Operator on the cluster. You have deployed automation controller using the Ansible Automation Platform Operator. Procedure Create a file named "backup-awx.yml" with the following contents: --- apiVersion: automationcontroller.ansible.com/v1beta1 kind: AWXBackup metadata: name: awxbackup-2024-07-15 namespace: my-namespace spec: deployment_name: controller Note The "deployment_name" above is the name of the automation controller deployment you intend to backup from. The namespace above is the one containing the automation controller deployment you intend to back up. Use the oc apply command to create the backup object in your cluster: USD oc apply -f backup-awx.yml 2.3. Backing up the Automation hub deployment Use this procedure to back up a deployment of the hub, including all hosted Ansible content. Prerequisites You must be authenticated with an OpenShift cluster. You have installed Ansible Automation Platform Operator on the cluster. You have deployed automation hub using the Ansible Automation Platform Operator. Procedure Log in to Red Hat OpenShift Container Platform . Navigate to Operators Installed Operators . Select your Ansible Automation Platform Operator deployment. Select the Automation Hub Backup tab. Click Create AutomationHubBackup . Enter a Name for the backup. Enter the Deployment name of the deployed Ansible Automation Platform instance being backed up. For example, if your automation hub must be backed up and the deployment name is aap-hub , enter 'aap-hub' in the Deployment name field. If you want to use a custom, pre-created pvc: Optionally, enter the name of the Backup persistent volume claim , Backup persistent volume claim namespace , Backup PVC storage requirements , and Backup PVC storage class . Click Create . A backup of the specified deployment is created and available for data recovery or deployment rollback.

Commands:
df -h | grep "/var/lib/pgsql/data"
--- apiVersion: automationcontroller.ansible.com/v1beta1 kind: AWXBackup metadata: name: awxbackup-2024-07-15 namespace: my-namespace spec: deployment_name: controller