Add OneLab Helm chart, Argo CD Application, and GitOps values for k3s
Made-with: Cursor
This commit is contained in:
28
app/playbooks/tasks/post-db-migration.yml
Normal file
28
app/playbooks/tasks/post-db-migration.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
|
||||
- name: Pull new postgres image
|
||||
shell: |
|
||||
docker image pull hub.andrewalliance.com/releases/postgres:17.8
|
||||
become: true
|
||||
when: (docker_images_tar is undefined) or (not docker_images_tar.stat.exists)
|
||||
|
||||
- name: Cleaning database
|
||||
shell: >
|
||||
docker volume rm onelab_pgdata
|
||||
become: true
|
||||
|
||||
- include_tasks: "{{ onelab_path }}/installation/latest/app/playbooks/tasks/start-db-only.yml"
|
||||
|
||||
- name: Restoring & Migrating database
|
||||
shell: |
|
||||
docker exec -i $(docker ps --filter "name=onelab_db|onelab-db" -q) pg_restore -Upostgres -dpostgres -v -Fc < {{ onelab_path }}/db-migration-postgres.tar.gz
|
||||
rm {{ onelab_path }}/db-migration-postgres.tar.gz
|
||||
become: true
|
||||
|
||||
- include_tasks: "{{ onelab_path }}/installation/latest/app/playbooks/tasks/stop-db-only.yml"
|
||||
|
||||
- name: Removing lock file
|
||||
shell: >
|
||||
rm {{ onelab_path }}/.lock_db_migration
|
||||
become: true
|
||||
|
||||
Reference in New Issue
Block a user