The ability to backup and restore your system is integrated into the platform setup playbook.
TL;DR
Summary:
# ./setup.sh -b // backup |
Make a backup
Simple Backup
You make a backup using the same setup.sh script that you use to install AAP:
# ./setup.sh -b |
Backup in a specific file
Backup files will be created on the same path that setup.sh script exists. It can be changed by specifying the following EXTRA_VARS:
./setup.sh -e ‘backup_dest=/path/to/backup_dir/‘ -b
Output :
You will see:
Using /etc/ansible/ansible.cfg as config file |
And in your folder:
-rw------- 1 root root 364053 Mar 7 09:49 automation-platform-backup-2024-03-07-09:48:20.tar.gz |
As an example in your .tar.gz:
![](IMAGE A FLOUTER.jpg)
Elaborate Backup
Here is a more elaborate scenario:
$ ./setup.sh -b -- -b -u admin [email protected] --ask-vault-password |
./setup.sh -b
: runs the backup--
: way to pass arguments to the internal playbook thatsetup.sh
calls-b
: tells Ansible to “become
“ root-u admin
: informs the playbook to connect as the user “admin
“[email protected]
: reads variables from a file encrypted with theansible-vault
--ask-vault-password
: tells Ansible to prompt for the password to decryptvault.yml
You will see the same with the Vault passwort to provide at the begining:
Using /etc/ansible/ansible.cfg as config file |
And in your folder:
-rw------- 1 root root 364053 Mar 7 09:49 automation-platform-backup-2024-03-07-09:48:20.tar.gz |
As an example in your .tar.gz:
![](IMAGE A FLOUTER.jpg)
Backup your backup .
Just place your .tar.gz file in an other place of your network…
Restore a backup
The last backup
You just need to run the setup.sh again, but with the argument -r. The command automatically uses the “latest”
# ./setup.sh -r |
Restore from a specific file .
A default restore path is used unless EXTRA_VARS are provided with a non-default path, as shown in the example below:
# ./setup.sh -e 'restore_backup_file=/path/to/nondefault/backup.tar.gz' -r |
Other backup
To restore from an older backup, you have two options:
Point the link automation-platform-backup-latest.tar.gz
to the file you want, and then run setup.sh -r
. This makes the selected file the official “latest
“ one:
# unlink automation-platform-backup-latest.tar.gz |
Restart service
After the restoration is done, you may need to restart the AAP services on your controller(s) before you can log in again:
# automation-controller-service start |
Documentations
https://www.redhat.com/sysadmin/ansible-backup-restore
https://docs.ansible.com/automation-controller/latest/html/administration/backup_restore.html