Skip to content

Commit

Permalink
Merge pull request #24 from jmontleon/BZ1549019
Browse files Browse the repository at this point in the history
Bug 1549019 - Partially work around connection upgrade issues
  • Loading branch information
dymurray committed Feb 27, 2018
2 parents c6bce9f + 3b0dd4c commit a6e8b86
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions roles/rhscl-mysql-apb-openshift/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

- name: Prepare for downgrade
shell: |
oc exec -n {{ namespace }} {{ oldpod.stdout }} -- /bin/bash -c "mysql -u root -e \"
oc exec -it -n {{ namespace }} {{ oldpod.stdout }} -- /bin/bash -c "mysql -u root -e \"
ALTER TABLE mysql.procs_priv MODIFY Grantor char(77) COLLATE utf8_bin NOT NULL DEFAULT '';
ALTER TABLE mysql.columns_priv MODIFY User char(16) NOT NULL default '';
ALTER TABLE mysql.user MODIFY User char(16) NOT NULL default '';
Expand All @@ -37,7 +37,7 @@
- not("5.6" in olddc.stdout)

- name: Backup source database
shell: oc exec -n {{ namespace }} {{ oldpod.stdout }} -- /bin/bash -c "mysqldump -u root --all-databases > /tmp/db.dump"
shell: oc exec -it -n {{ namespace }} {{ oldpod.stdout }} -- /bin/bash -c "mysqldump -u root --all-databases > /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 @@ -81,10 +81,10 @@
shell: oc cp -n {{ namespace }} /tmp/db.dump {{ newpod.stdout }}:/tmp/db.dump

- name: Restore database
shell: oc exec -n {{ namespace }} {{ newpod.stdout }} -- /bin/bash -c "mysql -u root < /tmp/db.dump"
shell: oc exec -it -n {{ namespace }} {{ newpod.stdout }} -- /bin/bash -c "mysql -u root < /tmp/db.dump"

- name: Run mysql_upgrade
shell: oc exec -n {{ namespace }} {{ newpod.stdout }} -- /bin/bash -c "mysql_upgrade -u root"
shell: oc exec -it -n {{ namespace }} {{ newpod.stdout }} -- /bin/bash -c "mysql_upgrade -u root"

- name: Remove old dc
openshift_v1_deployment_config:
Expand Down

0 comments on commit a6e8b86

Please sign in to comment.