blob: 4fc685c4531d04ef1f6cb77529119e632da96ecd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
---
- name: install golang
become: yes
apt: name="golang-1.21-go"
- name: link go bin
become: yes
file:
src: "/usr/lib/go-1.21/bin/go"
dest: "/usr/bin/go"
state: "link"
mode: "0755"
- name: git checkout lnurld
git:
repo: "{{lnurld_git}}"
dest: "{{lnurld_build_dir}}"
version: "{{lnurld_version}}"
- name: check if build exists
stat:
path: "{{lnurld_srv_dir}}/lnurld-{{lnurld_version}}.tar.gz"
register: build_file
- name: build
command: "go build"
args:
chdir: "{{lnurld_build_dir}}"
when: not build_file.stat.exists
- name: create build server dir
become: yes
file:
path: "{{lnurld_srv_dir}}"
mode: "0755"
state: "directory"
- name: create gz archive of lnurld
become: yes
archive:
path: "{{lnurld_build_dir}}/lnurld"
dest: "{{lnurld_srv_dir}}/lnurld-{{lnurld_version}}.tar.gz"
format: "gz"
# force a real tar for the single binary; the module otherwise gzips a lone
# file into a bare .gz that the server's unarchive can't extract.
force_archive: true
when: not build_file.stat.exists
|