Create a backup of your existing Red Hat Ansible Automation Platform deployment, remove some resources from the deployment, and then use the backup to restore the deployment.
Outcomes
Create a backup of your Red Hat Ansible Automation Platform deployment.
Restore your Red Hat Ansible Automation Platform deployment.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command prepares your environment and ensures that all required resources are available. The command performs the following tasks:
Removes automation controller and private automation hub resources created in previous chapters.
Downloads and extracts the installation bundle to the /home/student/aap2.2-bundle directory (if necessary).
Creates a job template, a machine credential, a project, and an inventory in automation controller. All of these resources use the Backup_Restore name.
[student@workstation ~]$ lab start compreview-backup
Specifications
Navigate to https://controller.lab.example.com and log in as the admin user with redhat as the password. Verify that the lab command created a job template, a machine credential, a project, and an inventory (using Backup_Restore as the name of each resource).
Create a backup of your Red Hat Ansible Automation Platform deployment by using the installer in the /home/student/aap2.2-bundle directory. Verify that the backup process created the automation-platform-backup-latest.tar.gz symbolic link within that directory.
Remove the automation controller resources that use the Backup_Restore name.
This step is not part of a typical backup and restore process. You remove resources in this exercise so that you can verify that the restoration process recovers the resources.
Use the previously created backup file to restore your Red Hat Ansible Automation Platform deployment. Verify that the restoration process recovered the Backup_Restore resources.
Use the automation controller web UI to verify the existence of the resources that use the Backup_Restore name.
Navigate to https://controller.lab.example.com and log in as the admin user with redhat as the password.
Navigate to → . The Backup_Restore job template uses the Backup_Restore machine credential, the Backup_Restore project, and the Backup_Restore inventory.
Click the icon for the job template. The job succeeds and displays the following output:
...output omitted... ok: [workstation.lab.example.com] => { "msg": "This is the backup and restore job template." } ...output omitted...
Navigate to → . The Backup_Restore job template uses the Backup_Restore machine credential to connect to hosts in the Backup_Restore inventory.
Navigate to → . The Backup_Restore project contains the playbook used by the Backup_Restore job template and the inventory file used by the Backup_Restore inventory.
Navigate to → . The Backup_Restore inventory uses the inventory file sourced from the Backup_Restore project. The Backup_Restore inventory contains the workstation.lab.example.com host.
Create a backup of your Red Hat Ansible Automation Platform deployment.
From a terminal window, become the root user, using student as the password.
[student@workstation ~]$sudo -i[sudo] password for student:student[root@workstation ~]#
Change to the /home/student/aap2.2-bundle directory.
[root@workstation ~]# cd /home/student/aap2.2-bundle/Initiate the backup process using the setup.sh script. The script takes a few minutes to complete. If your Red Hat Ansible Automation Platform deployment included automation mesh, then your output also displays the control2.lab.example.com host.
[root@workstation aap2.2-bundle]# ./setup.sh -b
..output omitted...
PLAY RECAP *********************************************************************
controller.lab.example.com : ok=59 changed=33 ... failed=0 skipped=85 ...
hub.lab.example.com : ok=37 changed=14 ... failed=0 skipped=67 ...
localhost : ok=2 changed=0 ... failed=0 skipped=0 ...
The setup process completed successfully.
[warn] /var/log/tower does not exist. Setup log saved to backup.log.Verify that the backup created the automation-platform-backup-latest.tar.gz symbolic link. The symbolic link points to the latest backup file.
[root@workstation aap2.2-bundle]# ls -l automation-platform-backup-latest.tar.gz
lrwxrwxrwx. 1 root root 83 Aug 9 14:36 automation-platform-backup-latest.tar.gz -> /home/student/aap2.2-bundle/./automation-platform-backup-2022-08-09-14:34:24.tar.gzRemove the automation controller resources that use the Backup_Restore name.
This step is not part of a typical backup and restore process. You remove resources in this exercise so that you can verify that the restoration process recovers the resources.
Navigate to → . Select the job template and click . Verify that you want to delete the template by clicking .
Navigate to → . Select the machine credential and click . Verify that you want to delete the credential by clicking .
Navigate to → . Select the inventory and click . Verify that you want to delete the inventory by clicking .
Navigate to → . Select the project and click . Verify that you want to delete the project by clicking .
Recover your Red Hat Ansible Automation Platform deployment.
Initiate the restoration process using the setup.sh script in the /home/student/aap2.2-bundle directory. The script takes a few minutes to complete. If your Red Hat Ansible Automation Platform deployment included automation mesh, then your output also displays the control2.lab.example.com host.
[root@workstation aap2.2-bundle]# ./setup.sh -r
..output omitted...
PLAY RECAP *********************************************************************
controller.lab.example.com : ok=60 changed=21 ... failed=0 skipped=85 ...
db.lab.example.com : ok=6 changed=6 ... failed=0 skipped=0 ...
hub.lab.example.com : ok=35 changed=13 ... failed=0 skipped=56 ...
The setup process completed successfully.
[warn] /var/log/tower does not exist. Setup log saved to backup.log.Navigate to → . The restoration process recovered the machine credential.
Navigate to → . The restoration process recovered the inventory.
Navigate to → . The restoration process recovered the project.
Navigate to → . The restoration process recovered the job template.
Click the icon for the job template. The job succeeds and displays the following output:
...output omitted... ok: [workstation.lab.example.com] => { "msg": "This is the backup and restore job template." } ...output omitted...