Perform a backup of the Red Hat Ansible Automation Platform databases and configuration files.
Outcomes
Back up the existing Ansible Automation Platform installation.
Restore the Ansible Automation Platform configuration and database from an existing backup.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command downloads and extracts the installation archive to the /home/student/aap2.2-bundle directory. It also replaces the inventory file in the extracted archive with the inventory file used during the initial installation.
[student@workstation ~]$ lab start admin-recovery
Procedure 9.2. Instructions
Back up your existing Red Hat Ansible Automation Platform installation.
On workstation, open a terminal and use the sudo command to change to 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/Run the ./setup.sh -b command to start the back up process. The back up only takes a few minutes to complete.
[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.List the contents of the current directory to verify that the backup archive exists. In addition to the archive, the automation-platform-backup-latest.tar.gz symbolic link points to the latest archive file.
[root@workstation aap2.2-bundle]#ls -1automation-platform-backup-2022-06-28-17:29:16.tar.gzautomation-platform-backup-latest.tar.gzbackup.log bundle collections group_vars images inventory licenses README.md setup.sh
Change the password for the automation controller admin user to redhat2 using the awx-manage command.
This step is for demonstration purposes only and is not part of a normal backup and restoration procedure.
This step demonstrates that any changes made after performing a back up are not restored by the backup archive.
Log in to the controller.lab.example.com server as the awx user. Because of existing SSH keys, you do not need to enter a password.
[root@workstation aap2.2-bundle]# ssh awx@controller.lab.example.com
...output omitted...
[awx@controller ~]$Run the awx-manage command to change the password for the admin user. Use redhat2 as the new password.
[awx@controller ~]$awx-manage changepassword adminChanging password for user 'admin' Password:redhat2Password (again):redhat2Password changed successfully for user 'admin'
Exit from the controller.lab.example.com server.
[awx@controller ~]$ exit
logout
Connection to controller.lab.example.com closed.Confirm that you can log in to the automation controller web UI using the new password. Navigate to https://controller.lab.example.com and log in as the admin user with redhat2 as the password.
After successfully logging in, click → .
Restore the Ansible Automation Platform configuration and database.
As the root user on workstation, change to the /home/student/aap2.2-bundle directory.
[root@workstation ~]# cd /home/student/aap2.2-bundle/Run the ./setup.sh -r command to restore the backup. The restoration operation only takes a few minutes to complete.
[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 restore.log.Remember to use the -r option with the setup.sh script. If you forget, then the setup.sh script performs a clean installation but does not restore your backup.
If that happens, wait until the installation process finishes and then repeat this step with the -r option to restore the backup.
Exit from the root session.
[root@workstation aap2.2-bundle]# exitConfirm that the restoration process reverted the password for the automation controller admin user. It should be set to whatever is specified by the inventory file.
Navigate to https://controller.lab.example.com and attempt to log in as the admin user with redhat2 as the password. The log in attempt fails.
Attempt to log in again as the admin user with redhat as the password. The log in attempt succeeds.