Skip to content

Commit

Permalink
chore: also deactivate supabase_vault in test (#1439)
Browse files Browse the repository at this point in the history
* chore: also deactivate supabase_vault in test

* chore: check that refs are removed

* chore: add a pattern for when vault at end of line

* fix: yaml typo

* chore: retry on fail for initial installs

* chore: revert logic for ansible install
  • Loading branch information
samrose authored and soedirgo committed Feb 12, 2025
1 parent 2e4b0ae commit 1559c2d
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions ansible/tasks/test-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,34 @@
# cmd: sed -i.bak -e "s/pg_net,\ pgsodium,\ timescaledb/pg_net,\ timescaledb/g" -e "s/pgsodium.getkey_script=/#pgsodium.getkey_script=/g" /etc/postgresql/postgresql.conf
# when: debpkg_mode or stage2_nix

- name: Temporarily disable PG Sodium references in config
- name: Temporarily disable PG Sodium and Supabase Vault references in config
become: yes
become_user: postgres
shell:
cmd: >
sed -i.bak
-e 's/\(shared_preload_libraries = '\''.*\)pgsodium,\(.*'\''\)/\1\2/'
sed -i.bak
-e 's/\(shared_preload_libraries = '\''.*\)pgsodium,\(.*'\''\)/\1\2/'
-e 's/\(shared_preload_libraries = '\''.*\)supabase_vault,\(.*'\''\)/\1\2/'
-e 's/\(shared_preload_libraries = '\''.*\), *supabase_vault'\''/\1'\''/'
-e 's/pgsodium.getkey_script=/#pgsodium.getkey_script=/'
/etc/postgresql/postgresql.conf
when: debpkg_mode or stage2_nix

- name: Verify pgsodium and vault removal from config
become: yes
become_user: postgres
shell:
cmd: |
FOUND=$(grep -E "shared_preload_libraries.*pgsodium|shared_preload_libraries.*supabase_vault|^pgsodium\.getkey_script" /etc/postgresql/postgresql.conf)
if [ ! -z "$FOUND" ]; then
echo "Found unremoved references:"
echo "$FOUND"
exit 1
fi
register: verify_result
failed_when: verify_result.rc != 0
when: debpkg_mode or stage2_nix

- name: Start Postgres Database to load all extensions.
become: yes
become_user: postgres
Expand Down

0 comments on commit 1559c2d

Please sign in to comment.