Open jmiranda opened 1 year ago
Now that I'm looking at the archive_db playbook, I realized the vars are set by default but Ansible allows you to pass a variable as an environment variable similar to the force argument below.
ansible-playbook -e @secrets/vault_rimu -i inventories/pih_rimu.yml dba/restore_db.yml -l obdev2 -e 'force=true,archive_file=../build/archive_db/obdev1/openboxes.tgz'
However, I feel like there could be an easier way of overriding the variable.
After following the instructions written by @awalkowiak to archive and restore a remote database, we realized that we should probably parameterize the source archive used in the restore_db.yml playbook.
Here are the instructions that Artur sent to me.
Run this to pull db from obnav (this will download db archive to openboxes-devops/ansible/build/archive_db/:
Run this to upload the db pulled with command above:
Both commands will take a couple of minutes.
Optionals: If you'd like to pull db from other server than I put in the 1st command, then change the last param to be one of: dbprd, dbstg, obdev1-5
If you changed the db that you are pulling, then you have to go to the restore_db.yml and change this line: https://github.com/openboxes/openboxes-devops/blob/master/ansible/dba/restore_db.yml#L5 to look into proper directory (you have to change the hardcoded /dbprd/ part)