|
1 | 1 | - name: PostgREST - system user
|
2 | 2 | user: name=postgrest
|
3 | 3 |
|
4 |
| -- name: PostgREST - add Postgres PPA gpg key |
5 |
| - apt_key: |
6 |
| - url: https://www.postgresql.org/media/keys/ACCC4CF8.asc |
7 |
| - state: present |
8 |
| - |
9 |
| -- name: PostgREST - add Postgres PPA |
10 |
| - apt_repository: |
11 |
| - repo: "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg {{ postgresql_major }}" |
12 |
| - state: present |
13 |
| - |
14 |
| -- name: PostgREST - update apt cache |
15 |
| - apt: |
16 |
| - update_cache: yes |
17 |
| - |
18 |
| -# libpq is a C library that enables user programs to communicate with |
19 |
| -# the PostgreSQL database server. |
20 |
| -- name: PostgREST - system dependencies |
21 |
| - apt: |
22 |
| - pkg: |
23 |
| - - libpq5 |
24 |
| - - libnuma-dev |
25 |
| - |
26 |
| -- name: PostgREST - remove Postgres PPA gpg key |
27 |
| - apt_key: |
28 |
| - url: https://www.postgresql.org/media/keys/ACCC4CF8.asc |
29 |
| - state: absent |
30 |
| - |
31 |
| -- name: PostgREST - remove Postgres PPA |
32 |
| - apt_repository: |
33 |
| - repo: "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg {{ postgresql_major }}" |
34 |
| - state: absent |
35 |
| - |
36 |
| -- name: postgis - ensure dependencies do not get autoremoved |
| 4 | +- name: PostgREST - install from nix postgrest flakes |
| 5 | + become: yes |
37 | 6 | shell: |
|
38 |
| - set -e |
39 |
| - apt-mark manual libpq5* |
40 |
| - apt-mark manual libnuma* |
41 |
| - apt-mark auto libnuma*-dev |
42 |
| -
|
43 |
| -- name: PostgREST - download ubuntu binary archive (arm) |
44 |
| - get_url: |
45 |
| - url: "https://github.com/PostgREST/postgrest/releases/download/v{{ postgrest_release }}/postgrest-v{{ postgrest_release }}-ubuntu-aarch64.tar.xz" |
46 |
| - dest: /tmp/postgrest.tar.xz |
47 |
| - checksum: "{{ postgrest_arm_release_checksum }}" |
48 |
| - timeout: 60 |
49 |
| - when: platform == "arm64" |
50 |
| - |
51 |
| -- name: PostgREST - download ubuntu binary archive (x86) |
52 |
| - get_url: |
53 |
| - url: "https://github.com/PostgREST/postgrest/releases/download/v{{ postgrest_release }}/postgrest-v{{ postgrest_release }}-linux-static-x64.tar.xz" |
54 |
| - dest: /tmp/postgrest.tar.xz |
55 |
| - checksum: "{{ postgrest_x86_release_checksum }}" |
56 |
| - timeout: 60 |
57 |
| - when: platform == "amd64" |
58 |
| - |
59 |
| -- name: PostgREST - unpack archive in /opt |
60 |
| - unarchive: |
61 |
| - remote_src: yes |
62 |
| - src: /tmp/postgrest.tar.xz |
63 |
| - dest: /opt |
64 |
| - owner: postgrest |
65 |
| - mode: '0755' |
| 7 | + sudo -u wal-g bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:postgrest/postgrest/v{{ postgrest_release }}" |
| 8 | + when: stage2_nix |
| 9 | + |
| 10 | +- name: Create symlink for PostgREST from Nix profile to /opt |
| 11 | + ansible.builtin.file: |
| 12 | + src: /home/postgrest/.nix-profile/bin/postgrest |
| 13 | + dest: /opt/postgrest |
| 14 | + state: link |
| 15 | + force: yes # This will replace existing file/symlink if it exists |
66 | 16 |
|
67 | 17 | - name: create directories
|
68 | 18 | file:
|
|
0 commit comments