-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yaml
322 lines (274 loc) Β· 8.25 KB
/
playbook.yaml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
---
- hosts: all
vars:
home: "{{ lookup('env', 'HOME') }}"
tasks:
- name: Create ~/code Directory
file:
path: "{{ home }}/code"
state: directory
mode: "750"
- name: Clone container-related git repos
ansible.builtin.git:
repo: "{{ item }}"
dest: '{{ home }}/code/{{ item | urlsplit("path") }}'
depth: 1
tags: containers
loop: "{{ lookup('file', 'git-repos.txt').splitlines() }}"
- name: Add source repository into sources list
ansible.builtin.apt_repository:
repo: deb-src https://mirrors.kernel.org/ubuntu/ jammy main restricted
state: present
become: true
- name: Install build dependencies for runc
apt:
state: present
name: "{{ item }}"
loop:
- golang
- libseccomp2
- libseccomp-dev
become: true
when: ansible_os_family == 'Debian'
- name: Install build dependencies for crun
apt:
state: present
name: "{{ item }}"
loop:
- make
- git
- gcc
- build-essential
- pkgconf
- libtool
- libsystemd-dev
- libprotobuf-c-dev
- libcap-dev
- libseccomp-dev
- libyajl-dev
- go-md2man
- autoconf
- python3
- automake
become: true
when: ansible_os_family == 'Debian'
- name: Build container-image
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/container-image"
- name: Install build dependencies for skopeo
apt:
state: present
name: "{{ item }}"
loop:
- libdevmapper-dev
- libgpgme-dev
- go-md2man
become: true
when: ansible_os_family == 'Debian'
- name: Install build dependencies for youki
apt:
state: present
name: "{{ item }}"
loop:
- pkg-config
- libsystemd-dev
- libdbus-glib-1-dev
- build-essential
- libelf-dev
- libseccomp-dev
become: true
when: ansible_os_family == 'Debian'
- name: Install build dependencies for containerd
apt:
state: present
name: "{{ item }}"
loop:
- libbtrfs-dev
- btrfs-progs
become: true
when: ansible_os_family == 'Debian'
- name: Install build dependencies for conmon
apt:
state: present
name: "{{ item }}"
loop:
- gcc
- git
- libc6-dev
- libglib2.0-dev
- libseccomp-dev
- pkg-config
- make
become: true
when: ansible_os_family == 'Debian'
- name: Install runtime dependencies for rootlesskit
apt:
state: present
name: "{{ item }}"
loop:
- uidmap
become: true
when: ansible_os_family == 'Debian'
- name: Build runc
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/runc"
- name: Install runc
become: true
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/runc"
target: install
- name: configue crun
ansible.builtin.shell: ./autogen.sh && ./configure
args:
chdir: "{{ home }}/code/fwilhe-containers/crun"
- name: Build crun
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/crun"
- name: Install crun
become: true
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/crun"
target: install
- name: configue bubblewrap
ansible.builtin.shell: ./autogen.sh
args:
chdir: "{{ home }}/code/fwilhe-containers/bubblewrap"
- name: Build bubblewrap
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/bubblewrap"
- name: Install bubblewrap
become: true
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/bubblewrap"
target: install
- name: Build ignite
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/ignite"
target: ignite
params:
GO_MAKE_TARGET: local
- name: Install ignite
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/ignite"
target: install
params:
GO_MAKE_TARGET: local
- name: Build containerd
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/containerd"
- name: Build CNI plugins
ansible.builtin.shell: ./build_linux.sh
args:
chdir: "{{ home }}/code/fwilhe-containers/plugins"
- name: Create /usr/local/libexec/cni Directory
become: true
file:
path: /usr/local/libexec/cni
state: directory
mode: "777"
- name: Install CNI plugins
become: true
ansible.builtin.shell: cp bin/* /usr/local/libexec/cni
args:
chdir: "{{ home }}/code/fwilhe-containers/plugins"
- name: Install containerd
become: true
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/containerd"
target: install
# - name: Build docker cli
# community.general.make:
# chdir: ~/code/docker/cli
# target: binary
- name: Build skopeo
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/skopeo"
- name: Install skopeo
become: true
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/skopeo"
target: install
- name: Install build dependencies for gvisor
apt:
state: present
name: "{{ item }}"
loop:
- clang
- name: Download bazel to build gvisor
become: true
get_url:
url: https://releases.bazel.build/6.1.1/release/bazel-6.1.1-linux-x86_64
dest: /usr/local/bin/bazel
mode: "0777"
- name: Build gvisor
ansible.builtin.shell:
cmd: bazel build -c opt //debian:debian
chdir: "{{ home }}/code/fwilhe-containers/gvisor"
- name: install the runsc binary
become: true
ansible.builtin.apt:
deb: "{{ home }}/code/fwilhe-containers/gvisor/bazel-bin/debian/debian.deb"
- name: Build cri-o
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/cri-o"
- name: Install cri-o
become: true
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/cri-o"
target: install
- name: Build conmon
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/conmon"
- name: Install conmon
become: true
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/conmon"
target: install
- name: Build rootlesskit
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/rootlesskit"
- name: Install rootlesskit
become: true
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/rootlesskit"
target: install
- name: Install build dependencies for slirp4netns
apt:
state: present
name: "{{ item }}"
loop:
- libglib2.0-dev
- libslirp-dev
- libcap-dev
- libseccomp-dev
become: true
when: ansible_os_family == 'Debian'
- name: configue slirp4netns
ansible.builtin.shell: ./autogen.sh && ./configure --prefix=/usr
args:
chdir: "{{ home }}/code/fwilhe-containers/slirp4netns"
- name: Build slirp4netns for rootless networking in podman
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/slirp4netns"
- name: Install slirp4netns
become: true
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/slirp4netns"
target: install
- name: Build ctop
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/ctop"
target: build
- name: Build ctop
become: true
ansible.builtin.shell:
cmd: cp ctop /usr/local/bin
chdir: "{{ home }}/code/fwilhe-containers/ctop"
- name: Build podman
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/podman"
- name: Install podman
become: true
community.general.make:
chdir: "{{ home }}/code/fwilhe-containers/podman"
target: install