Skip to content

Commit

Permalink
Actually drop mongo database
Browse files Browse the repository at this point in the history
The echo command we were using wasn't actually dropping the mongo
database, but rather echoing 'db.dropDatabase();' | mongo pulp_database

This resulted in data being restored on an existing database.

So the mongo database stayed during restore. We didn't notice many issues
because not much is in the mongo database on a clean satellite install.

Fixes #259
  • Loading branch information
John Mitsch committed Nov 29, 2017
1 parent aa059b6 commit c7b59a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion roles/satellite-clone/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
command: katello-installer --capsule-dns false --capsule-dhcp false --capsule-tftp false
when: satellite_version == 6.1
- name: run Satellite 6.2 installer
command: satellite-installer --scenario satellite --foreman-proxy-dns false --foreman-proxy-dhcp false --foreman-proxy-tftp false --no-enable-foreman-plugin-remote-execution --no-enable-foreman-proxy-plugin-remote-execution-ssh
command: satellite-installer --scenario satellite --foreman-proxy-dns false --foreman-proxy-dhcp false --foreman-proxy-tftp false
when: satellite_version == 6.2

- block:
Expand Down
2 changes: 1 addition & 1 deletion roles/satellite-clone/tasks/restore_mongo_dump.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: Drop old mongo database
command: echo 'db.dropDatabase();' | mongo pulp_database
command: mongo pulp_database --eval "db.dropDatabase()"

- name: Restore new mongo data
command: mongorestore --host localhost {{ backup_dir }}/mongo_dump/pulp_database/

0 comments on commit c7b59a0

Please sign in to comment.