Skip to content

Commit

Permalink
DO NOT MERGE - debugging #259
Browse files Browse the repository at this point in the history
  • Loading branch information
John Mitsch committed Nov 29, 2017
1 parent aa059b6 commit 857e14b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions roles/satellite-clone/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
yum: name=satellite state=latest
when: satellite_version == 6.2

- name: Check for pulp event_listeners
command: mongo pulp_database --eval "DBQuery.shellBatchSize = 10000000; db.event_listeners.find().shellPrint()"

# The postgres user is created after installing postgresql packages, so
# we perform this owner/group change at this point rather than earlier
- name: change owner of backup directory to postgres
Expand Down Expand Up @@ -158,6 +161,9 @@
command: restorecon -R /
when: restorecon

- name: Check for pulp event_listeners
command: mongo pulp_database --eval "DBQuery.shellBatchSize = 10000000; db.event_listeners.find().shellPrint()"

# Run Satellite installer
- name: run Satellite 6.1 installer
command: katello-installer --capsule-dns false --capsule-dhcp false --capsule-tftp false
Expand All @@ -166,10 +172,16 @@
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
when: satellite_version == 6.2

- name: Check for pulp event_listeners
command: mongo pulp_database --eval "DBQuery.shellBatchSize = 10000000; db.event_listeners.find().shellPrint()"

- block:
# restore backup data
- include: restore.yml

- name: Check for pulp event_listeners
command: mongo pulp_database --eval "DBQuery.shellBatchSize = 10000000; db.event_listeners.find().shellPrint()"

- name: Restart katello-service
command: katello-service start

Expand All @@ -196,6 +208,9 @@
- name: Run installer upgrade (satellite 6.2 only)
command: satellite-installer --upgrade
when: satellite_version == 6.2

- name: Check for pulp event_listeners
command: mongo pulp_database --eval "DBQuery.shellBatchSize = 10000000; db.event_listeners.find().shellPrint()"

- name: Test Satellite
command: hammer ping
Expand Down Expand Up @@ -232,6 +247,9 @@
- name: copy disassociate_capsules.rb output
local_action: copy content={{ clone_disassociate_capsules }} dest={{ playbook_dir }}/logs/reassociate_capsules.txt

- name: Check for pulp event_listeners
command: mongo pulp_database --eval "DBQuery.shellBatchSize = 10000000; db.event_listeners.find().shellPrint()"

- debug:
msg: "****NOTE**** Your Satellite's hostname is updated to match the original Satellite
****NOTE**** Your Satellite's password is updated to changeme"
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 857e14b

Please sign in to comment.