equal
deleted
inserted
replaced
1 --- |
1 --- |
2 |
2 |
3 - name: install golang |
3 - name: install golang |
4 become: yes |
4 become: yes |
5 apt: name="golang-go" |
5 apt: name="golang-1.21-go" |
|
6 |
|
7 - name: link go bin |
|
8 become: yes |
|
9 file: |
|
10 src: "/usr/lib/go-1.21/bin/go" |
|
11 dest: "/usr/bin/go" |
|
12 state: "link" |
|
13 mode: "0755" |
6 |
14 |
7 - name: unarchive nostr relayer |
15 - name: unarchive nostr relayer |
8 unarchive: |
16 unarchive: |
9 remote_src: yes |
17 remote_src: yes |
10 src: "{{relayer_tar}}" |
18 src: "{{relayer_tar}}" |
11 dest: "/tmp/" |
19 dest: "/tmp/" |
12 creates: "{{relayer_build_dir}}" |
20 creates: "{{relayer_build_dir}}" |
13 |
21 |
14 # update name |
22 # update name |
15 - name: update relayer nip11 info |
23 - name: update relayer nip11 name |
16 lineinfile: |
24 lineinfile: |
17 path: "{{relayer_main_src}}" |
25 path: "{{relayer_main_src}}" |
18 regexp: "^(\\s*)return \"WhitelistedRelay\"$" |
26 regexp: "^(\\s*)return \"WhitelistedRelay\"$" |
19 line: "\\1return \"{{relayer_name}}\"" |
27 line: "\\1return \"{{relayer_name}}\"" |
20 backrefs: yes |
28 backrefs: yes |
32 - {"k": "Contact:", "v": "{{relayer_admin_contact}}"} |
40 - {"k": "Contact:", "v": "{{relayer_admin_contact}}"} |
33 - {"k": "Version:", "v": "{{relayer_version}}"} |
41 - {"k": "Version:", "v": "{{relayer_version}}"} |
34 |
42 |
35 - name: check if relayer build exists |
43 - name: check if relayer build exists |
36 stat: |
44 stat: |
37 path: "{{relayer_build_dir}}/whitelisted/whitelisted" |
45 path: "{{relayer_build_dir}}/examples/whitelisted/whitelisted" |
38 register: build_file |
46 register: build_file |
39 |
47 |
40 - name: build relayer |
48 - name: build relayer |
41 command: "go build" |
49 command: "go build" |
42 args: |
50 args: |
43 chdir: "{{relayer_build_dir}}/whitelisted" |
51 chdir: "{{relayer_build_dir}}/examples/whitelisted" |
44 when: not build_file.stat.exists |
52 when: not build_file.stat.exists |
45 |
53 |
46 - name: create build server dir |
54 - name: create build server dir |
47 become: yes |
55 become: yes |
48 file: |
56 file: |
53 |
61 |
54 - name: copy bin to build server dir |
62 - name: copy bin to build server dir |
55 become: yes |
63 become: yes |
56 copy: |
64 copy: |
57 remote_src: yes |
65 remote_src: yes |
58 src: "{{relayer_build_dir}}/whitelisted/whitelisted" |
66 src: "{{relayer_build_dir}}/examples/whitelisted/whitelisted" |
59 dest: "{{relayer_srv_dir}}/nostr-relayer-whitelisted" |
67 dest: "{{relayer_srv_dir}}/nostr-relayer-whitelisted" |
60 when: not build_file.stat.exists |
68 when: not build_file.stat.exists |