-
-
Notifications
You must be signed in to change notification settings - Fork 213
feat(ansible): add pgBackRest tasks and configurations #1878
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
base: develop
Are you sure you want to change the base?
Changes from 4 commits
5be45c3
32ffede
16c6474
9bb0eb8
e9b3216
56e3d22
6b71d69
7345b6a
b191228
365fa48
32c047e
b223518
fb412ba
7a50d3b
865da58
6d74ce5
dc709b7
f7b9c60
1d62a99
7d4e051
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| [global] | ||
| # process-max = 1 | ||
|
|
||
| [archive-get] | ||
| # process-max = 1 | ||
|
|
||
| [archive-push] | ||
| # process-max = 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| [global] | ||
| archive-async = n | ||
| archive-copy = y | ||
| backup-standby = prefer | ||
| compress-type = zst | ||
| delta = y | ||
| expire-auto = n | ||
| link-all = y | ||
| log-level-console = info | ||
| log-level-file = detail | ||
| log-subprocess = y | ||
| resume = n | ||
| start-fast = y | ||
| [supabase] | ||
| pg1-path = /var/lib/postgresql/data | ||
| pg1-socket-path = /run/postgresql | ||
| pg1-user = supabase_admin | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| [supabase] | ||
| repo1-block = y | ||
| repo1-bundle = y | ||
| # repo1-path = <foo> | ||
| repo1-retention-diff = 1 | ||
| repo1-retention-full = 28 | ||
| repo1-retention-full-type = time | ||
| repo1-retention-history = 0 | ||
| # repo1-s3-bucket= <foo> | ||
| # repo1-s3-endpoint= <foo> | ||
| repo1-s3-key-type = auto | ||
| # repo1-s3-region = <foo> | ||
| repo1-storage-upload-chunk-size = 10MiB | ||
| repo1-type = s3 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [supabase] | ||
| # archive-async = y |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [supabase] | ||
| # repo-cipher-pass = {{ generated pass }} | ||
| # repo-cipher-type = aes-256-cbc |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| - name: Create pgBackRest group | ||
| group: | ||
| name: pgbackrest | ||
| state: present | ||
| when: nixpkg_mode | ||
jchancojr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Create pgBackRest user | ||
| user: | ||
| name: pgbackrest | ||
| comment: pgBackRest user | ||
| group: pgbackrest | ||
| groups: pgbackrest, postgres | ||
| shell: /sbin/nologin | ||
| system: true | ||
| home: /var/lib/pgbackrest | ||
| when: nixpkg_mode | ||
jchancojr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Install pgBackRest | ||
| become: true | ||
| become_user: pgbackrest | ||
| shell: | | ||
| sudo -u pgbackrest bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#pg-backrest" | ||
| when: stage2_nix | ||
|
|
||
| - name: Create needed directories for pgBackRest | ||
| file: | ||
| path: "{{ backrest_dir }}" | ||
| state: directory | ||
| owner: pgbackrest | ||
| group: postgres | ||
| mode: '0770' | ||
| loop: | ||
| - /etc/pgbackrest/conf.d | ||
| - /var/lib/pgbackrest | ||
| - /var/spool/pgbackrest | ||
| - /var/log/pgbackrest | ||
| loop_control: | ||
| loop_var: backrest_dir | ||
| when: nixpkg_mode | ||
jchancojr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Symlink pgbackrest.conf | ||
| file: | ||
| path: /etc/pgbackrest/pgbackrest.conf | ||
| src: /etc/pgbackrest.conf | ||
| state: link | ||
| force: true | ||
|
|
||
| - name: Move pgBackRest files to /etc/pgbackrest | ||
| copy: | ||
| dest: "/etc/pgbackrest/{{ conf_item['path'] }}/{{ conf_item['name'] }}" | ||
| group: postgres | ||
| mode: '0644' | ||
| owner: pgbackrest | ||
| src: "files/pgbackrest_config/{{ conf_item['name'] }}" | ||
| loop: | ||
| - {name: computed_globals.conf, path: conf.d} | ||
| - {name: pgbackrest.conf, path: ''} | ||
| - {name: repo1_async.conf, path: conf.d} | ||
| - {name: repo1_encrypted.conf, path: conf.d} | ||
| - {name: repo1.conf, path: conf.d} | ||
| loop_control: | ||
| loop_var: conf_item | ||
| when: stage2_nix | ||
jchancojr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Symlink pgBackRest binary | ||
| file: | ||
| path: /usr/bin/pgbackrest | ||
| src: /var/lib/pgbackrest/.nix-profile/bin/pgbackrest | ||
| state: link | ||
|
|
||
| - name: Sticky bit the pgBackRest binary | ||
| file: | ||
| path: /var/lib/pgbackrest/.nix-profile/bin/pgbackrest | ||
| mode: '4755' | ||
|
||
| become: true | ||
Uh oh!
There was an error while loading. Please reload this page.