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

Add command for updating the wal snapshot #430

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ansible/host_vars/ams-api.ooni.nu/.travis.vault
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$ANSIBLE_VAULT;1.1;AES256
66653334346330376530353461653332313431346436386639633730316162653632643731393835
3864313434333838373737333963316561646636356163610a636433626539323939393937623335
32376439373039653861663835323061633861653838326633343365656331636435343934333066
6463616362646631390a653933333662313230636462626263343966363032613731613437376536
62393833643935646532366137343565313031653137396337343539393538616438343261616461
3335393836306165653732353065333666636461343661333233
17 changes: 17 additions & 0 deletions ansible/templates/metadb-snapshot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
sudo docker run --net=host --rm -ti --user 2100:2100 \
-v /srv/pl-psql:/srv/pl-psql:rw \
-v /srv/pl-psql_ssl:/srv/pl-psql_ssl:ro \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/groups:/etc/groups:ro \
--env PGDATA=/srv/pl-psql \
--env PGDATABASE=metadb \
--env PGUSER=shovel \
--env PGPASSWORD="{{ shovel_postgres_password }}" \
--env PGHOST="37.218.240.56" \
--env AWS_DEFAULT_REGION=us-east-1 \
--env AWS_ACCESS_KEY_ID="{{ metadb_wal_s3_key_id }}" \
--env AWS_SECRET_ACCESS_KEY="{{ metadb_wal_s3_access_key }}" \
--env PUSHGATEWAY_CERT="/srv/pl-psql_ssl/pusher/{{ inventory_hostname }}.cert" \
--env PUSHGATEWAY_KEY="/srv/pl-psql_ssl/pusher/{{ inventory_hostname }}.key" \
openobservatory/sysadmin-postgres-metadb:20190419-572779cb \
metadb_s3_tarz
9 changes: 9 additions & 0 deletions ansible/update-wal-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This task is to copy the script to copy the script for running a metadb snapshot update into /srv/
# You shall then ssh into hkgmetadb.infra.ooni.io and trigger the script via sh
# /srv/metadb-snapshot.sh inside of a screen/tmux session
- hosts: hkgmetadb.infra.ooni.io
tasks:
- name: write /srv/metadb-snapshot.sh
template:
src: metadb-snapshot.sh
dest: /srv/metadb-snapshot.sh