|
1 | 1 | - name: UFW - Allow connections to GoTrue metrics exporter |
2 | | - ufw: |
3 | | - rule: allow |
4 | | - port: "9122" |
| 2 | + community.general.ufw: |
| 3 | + port: '9122' |
| 4 | + rule: 'allow' |
5 | 5 |
|
6 | 6 | # use this user for the Gotrue build and for running the service |
7 | 7 | - name: Gotrue - system user |
8 | | - user: name=gotrue |
| 8 | + ansible.builtin.user: |
| 9 | + name: 'gotrue' |
| 10 | + state: 'present' |
9 | 11 |
|
10 | | -- name: Setting arch (x86) |
11 | | - set_fact: |
12 | | - arch: "x86" |
13 | | - when: platform == "amd64" |
14 | | - |
15 | | -- name: Setting arch (arm) |
16 | | - set_fact: |
17 | | - arch: "arm64" |
18 | | - when: platform == "arm64" |
| 12 | +- name: Setting arch as a fact |
| 13 | + ansible.builtin.set_fact: |
| 14 | + arch: >- |
| 15 | + {%- if platform == 'amd64' -%} |
| 16 | + x86 |
| 17 | + {%- elif platform == 'arm64' -%} |
| 18 | + arm64 |
| 19 | + {%- endif -%} |
19 | 20 |
|
20 | 21 | - name: gotrue - download commit archive |
21 | | - get_url: |
22 | | - url: "https://github.com/supabase/gotrue/releases/download/v{{ gotrue_release }}/auth-v{{ gotrue_release }}-{{ arch }}.tar.gz" |
23 | | - dest: /tmp/gotrue.tar.gz |
| 22 | + ansible.builtin.get_url: |
24 | 23 | checksum: "{{ gotrue_release_checksum }}" |
| 24 | + dest: '/tmp/gotrue.tar.gz' |
| 25 | + url: "https://github.com/supabase/gotrue/releases/download/v{{ gotrue_release }}/auth-v{{ gotrue_release }}-{{ arch }}.tar.gz" |
25 | 26 |
|
26 | | -- name: gotrue - create /opt/gotrue |
27 | | - file: |
28 | | - path: /opt/gotrue |
29 | | - state: directory |
30 | | - owner: gotrue |
31 | | - mode: 0775 |
32 | | - |
33 | | -- name: gotrue - create /etc/auth.d |
34 | | - file: |
35 | | - path: /etc/auth.d |
36 | | - state: directory |
37 | | - owner: gotrue |
38 | | - mode: 0775 |
| 27 | +- name: gotrue - create /opt/gotrue and /etc/auth.d |
| 28 | + ansible.builtin.file: |
| 29 | + mode: '0775' |
| 30 | + owner: 'gotrue' |
| 31 | + path: "{{ gotrue_dir_item }}" |
| 32 | + state: 'directory' |
| 33 | + loop: |
| 34 | + - '/etc/auth.d' |
| 35 | + - '/opt/gotrue' |
| 36 | + loop_control: |
| 37 | + loop_var: 'gotrue_dir_item' |
39 | 38 |
|
40 | 39 | - name: gotrue - unpack archive in /opt/gotrue |
41 | | - unarchive: |
42 | | - remote_src: yes |
43 | | - src: /tmp/gotrue.tar.gz |
44 | | - dest: /opt/gotrue |
45 | | - owner: gotrue |
| 40 | + ansible.builtin.unarchive: |
| 41 | + dest: '/opt/gotrue' |
| 42 | + owner: 'gotrue' |
| 43 | + remote_src: true |
| 44 | + src: '/tmp/gotrue.tar.gz' |
46 | 45 |
|
47 | 46 | # libpq is a C library that enables user programs to communicate with |
48 | 47 | # the PostgreSQL database server. |
|
52 | 51 | # - libpq-dev |
53 | 52 |
|
54 | 53 | - name: gotrue - create service file |
55 | | - template: |
56 | | - src: files/gotrue.service.j2 |
57 | | - dest: /etc/systemd/system/gotrue.service |
| 54 | + ansible.builtin.template: |
| 55 | + dest: '/etc/systemd/system/gotrue.service' |
| 56 | + src: 'files/gotrue.service.j2' |
58 | 57 |
|
59 | 58 | - name: gotrue - create optimizations file |
60 | | - template: |
61 | | - src: files/gotrue-optimizations.service.j2 |
62 | | - dest: /etc/systemd/system/gotrue-optimizations.service |
| 59 | + ansible.builtin.template: |
| 60 | + dest: '/etc/systemd/system/gotrue-optimizations.service' |
| 61 | + src: 'files/gotrue-optimizations.service.j2' |
63 | 62 |
|
64 | 63 | - name: gotrue - reload systemd |
65 | | - systemd: |
66 | | - daemon_reload: yes |
| 64 | + ansible.builtin.systemd_service: |
| 65 | + daemon_reload: true |
0 commit comments