File tree Expand file tree Collapse file tree 2 files changed +37
-10
lines changed Expand file tree Collapse file tree 2 files changed +37
-10
lines changed Original file line number Diff line number Diff line change 5
5
pkg :
6
6
- daemontools
7
7
8
- - name : WAL-G - download latest release
8
+ - name : wal-g system dependencies
9
+ apt :
10
+ pkg :
11
+ - liblzo2-dev
12
+ - cmake
13
+ - build-essential
14
+
15
+ # find platform architecture
16
+ - name : finding platform architecture
17
+ shell : if [ $(uname -m) = "aarch64" ]; then echo "arm64"; else echo "amd64"; fi
18
+ register : platform_output
19
+ - set_fact :
20
+ platform : " {{ platform_output.stdout }}"
21
+
22
+ # install go dependency for WAL-G
23
+ - name : wal-g go dependency
9
24
get_url :
10
- url : https://github.com/wal-g/wal-g/releases/download/v {{ wal_g_release }}/wal-g .linux-amd64 .tar.gz
25
+ url : " https://golang.org/dl/go {{ golang_version }}.linux-{{ platform }} .tar.gz"
11
26
dest : /tmp
12
- checksum : " {{ wal_g_release_checksum }}"
13
-
14
- - name : WAL-G - unpack archive
27
+ - name : unpack go archive
15
28
unarchive :
16
29
remote_src : yes
17
- src : /tmp/wal-g.linux-amd64.tar.gz
18
- dest : /tmp
19
- become : yes
30
+ src : " /tmp/go{{ golang_version }}.linux-{{ platform }}.tar.gz"
31
+ dest : /usr/local
32
+
33
+ # Download WAL-G
34
+ - name : download wal-g
35
+ shell :
36
+ cmd : go get github.com/wal-g/wal-g;
37
+ environment :
38
+ PATH : " {{ ansible_env.PATH }}:/usr/local/go/bin"
39
+ ignore_errors : yes
40
+ # ignore error https://github.com/wal-g/wal-g/issues/343#issuecomment-514544288
20
41
21
- - name : WAL-G - install
42
+ # Install WAL-G
43
+ - name : install wal-g
22
44
become : yes
23
45
shell :
24
- cmd : mv /tmp/wal-g /usr/local/bin/
46
+ cmd : make install && make deps && make pg_install
47
+ chdir : " {{ ansible_env.HOME }}/go/src/github.com/wal-g/wal-g"
48
+ environment :
49
+ GOBIN : " /usr/local/bin"
50
+ PATH : " {{ ansible_env.PATH }}:/usr/local/go/bin"
Original file line number Diff line number Diff line change @@ -45,5 +45,6 @@ postgresql_log_filename: "postgresql.log"
45
45
postgresql_log_rotation_age : 0
46
46
postgresql_log_rotation_size : 0
47
47
48
+ golang_version : " 1.15.4"
48
49
wal_g_release : " 0.2.15"
49
50
wal_g_release_checksum : sha1:e82d405121e0ccc322a323b9824e60c102b14004
You can’t perform that action at this time.
0 commit comments