-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update deploy process and add ansible migration script
- Loading branch information
Showing
6 changed files
with
47 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
- name: Perform DB migration | ||
hosts: servers | ||
remote_user: ubuntu | ||
vars: | ||
primary: lard-a | ||
|
||
tasks: | ||
- name: Copy the db folder to the remote | ||
ansible.builtin.copy: | ||
src: "{{ playbook_dir }}/../db/" | ||
dest: /etc/postgresql/16/db/ | ||
mode: "0755" | ||
become: true | ||
|
||
- name: Migrate primary | ||
when: inventory_hostname == primary | ||
become: true | ||
become_user: postgres | ||
block: | ||
- name: Create data partition tables in lard | ||
community.postgresql.postgresql_script: | ||
db: lard | ||
path: /etc/postgresql/16/db/partition.sql | ||
|
||
- name: Update public schema in lard | ||
community.postgresql.postgresql_script: | ||
db: lard | ||
path: /etc/postgresql/16/db/public.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
--- | ||
deploy_envars: | ||
- LARD_CONN_STRING: "" | ||
- STINFO_CONN_STRING: "" | ||
- LARD_CONN_STRING: | ||
- STINFO_CONN_STRING: | ||
|
||
deploy_files: | ||
- src: lard_ingestion.service | ||
dest: /etc/systemd/system | ||
mode: "0664" | ||
- src: "{{ playbook_dir }}/../target/release/lard_ingestion" | ||
dest: /usr/local/bin | ||
mode: "0755" | ||
- src: "{{ playbook_dir }}/../ingestion/resources" | ||
dest: /usr/local/bin | ||
mode: "0755" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
#!/bin/bash | ||
|
||
if ! cargo build --workspace --release; then | ||
exit 1 | ||
exit 1 | ||
fi | ||
|
||
pushd ansible || exit | ||
|
||
cp ../target/release/lard_ingestion roles/deploy/files/. | ||
cp -r ../ingestion/resources roles/deploy/files/. | ||
|
||
ansible-playbook -i inventory.yml deploy.yml --ask-vault-pass | ||
|
||
popd || exit |