]> git.openstreetmap.org Git - chef.git/commitdiff
Install wal-g on database servers
authorTom Hughes <tom@compton.nu>
Wed, 26 Jan 2022 14:57:01 +0000 (14:57 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 26 Jan 2022 14:57:01 +0000 (14:57 +0000)
cookbooks/db/recipes/base.rb
cookbooks/db/templates/default/wal-g.erb [new file with mode: 0644]

index 617392701f955f0c31a96f543be0683a4c72b447..280e2d6fe0908af5a7500838aec3ab7402b6425e 100644 (file)
@@ -146,3 +146,19 @@ template "/usr/local/bin/openstreetmap-wal-e" do
   mode "750"
   variables :s3_key => wal_secrets["s3_key"]
 end
+
+remote_file "/usr/local/bin/wal-g" do
+  action :create
+  source "https://github.com/wal-g/wal-g/releases/download/v1.1/wal-g-pg-ubuntu-20.04-amd64"
+  owner "root"
+  group "root"
+  mode "755"
+end
+
+template "/usr/local/bin/openstreetmap-wal-g" do
+  source "wal-g.erb"
+  owner "root"
+  group "postgres"
+  mode "750"
+  variables :s3_key => wal_secrets["s3_key"]
+end
diff --git a/cookbooks/db/templates/default/wal-g.erb b/cookbooks/db/templates/default/wal-g.erb
new file mode 100644 (file)
index 0000000..867bdac
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# DO NOT EDIT - This file is being maintained by Chef
+
+export WALE_S3_PREFIX="s3://openstreetmap-wal/"
+export AWS_ACCESS_KEY_ID="AKIAIQX2LTDOBIW4CZUQ"
+export AWS_SECRET_ACCESS_KEY="<%= @s3_key %>"
+export AWS_REGION="eu-west-2"
+
+exec /usr/local/bin/wal-g "$@" < /dev/null