Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1549019 - Partially work around connection upgrade issues #35

Merged
merged 1 commit into from
Feb 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions roles/rhscl-postgresql-apb/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- block:
- name: Find pod we need to update
shell: kubectl get pods -n {{ namespace }} -l app=rhscl-postgresql-apb -o custom-columns=name:.metadata.name --no-headers
shell: oc get pods -n {{ namespace }} -l app=rhscl-postgresql-apb -o custom-columns=name:.metadata.name --no-headers
register: oldpod

- name: Find dc we will clean up
Expand All @@ -14,7 +14,7 @@
when: cluster=="kubernetes"

- name: Backup source database
shell: kubectl exec -n {{ namespace }} {{ oldpod.stdout }} -- /bin/bash -c "pg_dumpall -f /tmp/db.dump"
shell: oc exec -it -n {{ namespace }} {{ oldpod.stdout }} -- /bin/bash -c "pg_dumpall -f /tmp/db.dump"

- name: Copy over db backup
shell: oc cp -n {{ namespace }} {{ oldpod.stdout }}:/tmp/db.dump /tmp/db.dump
Expand Down Expand Up @@ -52,14 +52,14 @@
timeout: 300

- name: Find pod we need to restore
shell: kubectl get pods -n {{ namespace }} --show-all=false -l service=postgresql-{{ postgresql_version }}-{{ _apb_plan_id }} -o custom-columns=name:.metadata.name --no-headers
shell: oc get pods -n {{ namespace }} --show-all=false -l service=postgresql-{{ postgresql_version }}-{{ _apb_plan_id }} -o custom-columns=name:.metadata.name --no-headers
register: newpod

- name: Copy over db backup
shell: oc cp -n {{ namespace }} /tmp/db.dump {{ newpod.stdout }}:tmp/db.dump

- name: Restore database
shell: kubectl exec -n {{ namespace }} {{ newpod.stdout }} -- /bin/bash -c "psql -f /tmp/db.dump"
shell: oc exec -it -n {{ namespace }} {{ newpod.stdout }} -- /bin/bash -c "psql -f /tmp/db.dump"

- name: Remove deployment config
openshift_v1_deployment_config:
Expand Down