-
Notifications
You must be signed in to change notification settings - Fork 2
/
defaults.jinja
338 lines (308 loc) · 10 KB
/
defaults.jinja
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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
{% load_yaml as defaults %}
config:
containers:
# /etc/containers/containers.conf
containers: {}
network: {}
engine:
# crun: OCI runtime with support for cgroup V2
runtime: "crun"
storage:
# /etc/containers/storage.conf
storage:
# Primary storage driver
driver: "overlay"
runroot: "/run/containers/storage"
graphroot: "/var/lib/containers/storage"
# # storage options
# options:
# root-auto-userns-user: containers
# overlay:
# mount_program: "/usr/bin/fuse-overlayfs"
# mountopt: "nodev,metacopy=on"
mounts:
# /etc/containers/mounts.conf
# Global Mounts: The format of the mounts.conf is the volume format /SRC:/DEST,
# one mount per line. For example, a mounts.conf with the line
# - "/usr/share/secrets:/run/secrets"
# would cause the contents of the /usr/share/secrets directory on the host
# to be mounted on the /run/secrets directory inside the container.
# Setting mountpoints allows containers to use the files of the host.
mounts: []
policy:
# /etc/containers/policy.json
# Policy: Manages which registries you trust as a source of container images based on its location.
# The location is determined by the transport and the registry host of the image.
# Using this container image docker://docker.io/library/busybox as an example,
# docker is the transport and docker.io is the registry host.
default:
- type: insecureAcceptAnything
transports:
"docker-daemon":
"":
- type: insecureAcceptAnything
# settings for containers/init.sls and containers/lib.sls
podman:
system:
config_basepath: /etc/containers/podman.config
workdir_basepath: /etc/containers/podman.service
build_basepath: /var/lib/containers/podman-build
service_basepath: /etc/systemd/system
script_basepath: /usr/local/bin
desktop_basepath: /usr/local/share/applications
user:
config_basepath: ${HOME}/.config/podman.config
workdir_basepath: ${HOME}/.config/podman.service
build_basepath: ${HOME}/.local/lib/podman-build
service_basepath: ${HOME}/.config/systemd/user
script_basepath: ${HOME}/.local/bin
desktop_basepath: ${HOME}/.local/share/applications
compose:
compose_filename: docker-compose.yml
override_filename: docker-compose.override.yml
env_filename: .env
system:
config_basepath: /etc/containers/podman-compose.config
workdir_basepath: /etc/containers/podman-compose.service
build_basepath: /var/lib/containers/podman-compose-build
service_basepath: /etc/systemd/system
script_basepath: /usr/local/bin
desktop_basepath: /usr/local/share/applications
user:
config_basepath: ${HOME}/.config/podman-compose.config
workdir_basepath: ${HOME}/.config/podman-compose.service
build_basepath: ${HOME}/.local/lib/podman-compose-build
service_basepath: ${HOME}/.config/systemd/user
script_basepath: ${HOME}/.local/bin
desktop_basepath: ${HOME}/.local/share/applications
x11docker:
# default x11 docker switches
default:
- --backend=podman
- --xpra
empty: []
host:
- --backend=podman
- --hostdisplay
- --hostipc
- --cap-default
- --clipboard
- --gpu
# - --verbose
# - --webcam
pkg:
ubuntu:
source: ppa
branch: stable {# stable,testing #}
base:
- uidmap
- criu
- crun
- cri-o-runc
- cri-tools
- containernetworking-plugins
- slirp4netns
- fuse-overlayfs
- skopeo
- buildah
- podman
desktop:
# x11docker-tools
- tini
# x11docker-x11-tools
- xinit
- xauth
- xclip
- x11-utils
- x11-xkb-utils
- x11-xserver-utils
- xdg-utils
- xdotool
- dbus-x11
- xpra
- xserver-xephyr
- weston
- xwayland
# x11docker-gpu-tools
- mesa-utils
- mesa-utils-extra
- libxv1
- va-driver-all
manjaro:
base:
- crun
- catatonit
- netavark
- aardvark-dns
- buildah
- podman
- podman-compose
- podman-docker
- docker-compose
desktop:
- wtype
- weston
- xorg-xwayland
- podman-desktop
- podman-tui-git
{% endload %}
{%- set settings = salt['grains.filter_by']({'default': defaults},
grain='default', default= 'default', merge= salt['pillar.get']('containers', {})) %}
{% load_yaml as default_container %}
# name of the container pod, systemd service, oneshot, command, desktop app
name:
# type: "build", "service", "oneshot", "command", "desktop"
# build = build or pull image only, will not generate a systemd service
# service = systemd service: create and start command as a systemd service
# oneshot = systemd oneshot service: create a systemd oneshot execute service
# command = create a shell script to call the container from the commandline
# desktop = create a shell script using x11docker to call the container as a gui application
type: service
# name of the container image: x/y[:z]
image:
# optional tag, will be appended to image and on build time
tag: ""
# enabled: if false, service will be stopped, config files are removed
enabled: true
# absent (service, oneshot): if true also remove systemd service files
absent: false
# refresh: if true, container image will be pulled/build on every service start
refresh: true
# ephemeral (service, oneshot, command, desktop): remove existing container before start
ephemeral: true
# Set the user namespace mode for the container. options are "pick","auto","host","private"
# pick is analog to systemd nspawn and computes starting host_uid based on the container name hash
# if user != root then auto will be substituted by pick
userns: auto
# systemd options
systemd:
# systemd restart: "no, on-failure, on-success, on-abnormal, on-watchdog, on-abort, or always"
# default: "no" if type oneshot, else "on-failure"
restart: ""
# after, requires, wants: equal to systemd config
after: ""
requires: ""
wants: ""
# additional systemd properties for the [service] section
service: {}
# additional systemd properties for the [unit] section
unit: {}
# desktop options
desktop:
# template: group of options passed to x11docker: ['default', 'host', 'empty']
template: default
# options: list of strings: additional options for x11docker
options: []
# entry: desktop entry is used for .desktop file
entry:
# # https://specifications.freedesktop.org/desktop-entry-spec/latest/
# # mandatory entries: Name, Exec
Type: Application
# Name: Program-Name
# Exec: env X=Y name.sh
# # optional entries
# Comment: A Sentence to describe the application
# Terminal: true
# Icon: applications-internet
# Categories: Network;
# Keywords: android;emulator;
# environment: dict: add environment data: {key: value,}
environment: {}
# label: dict: add labels to container: {key:value,}
labels: {}
# storage: list of dicts: create volumes: [{name: volume_name, opts=[], labels={}, driver: local},]
storage: []
# volume: list of strings: use volumes: ["source-volume|host-dir:]container-dir[:options]",]
volumes: []
# ports: list of strings: expose container ports: ["[hostip]:hostport:containerport[/protocol]",]
ports: []
# files to be placed inside workdir, which will be available via "./"
# source can be file.managed: contents, source or special case symlink (see example)
files: {}
{# Example:
test.file:
mode: "600"
contents: |
this is the content
still.some.file:
source: salt://containers/test.file
template: jinja
# specify any file.managed attribute, environment will be put into context
defaults:
custom: this is a custom var that will be available in the jinja context
some.symlink.file:
symlink: /target/the/symlink/is/pointing
#}
# command: string, if set, will replace default command
command: ""
# args: string, if set, will add args for command, command must also be set
args: ""
# options: list of string: additional container options parameter for podman run
options: []
# build: if source != "", build container with args using "podman build <source>"
build:
source: ""
args: {}
# run before the service is started the first time
init:
command: ""
environment: {}
# run after updating the corresponding image to a newer image before starting the service
change:
command: ""
environment: {}
{% endload %}
{% load_yaml as default_compose %}
# name of the compose sevice and name of the controlling systemd service
name:
# type: "service"
# service = systemd service: create and start command as a systemd service
type: service
# enabled: if false, service will be stopped, config files are removed
enabled: true
# absent: if true also remove systemd service files
absent: false
# refresh: if true, container image will be pulled/build on every service start
refresh: true
# ephemeral: remove existing container before start
ephemeral: true
# Set the user namespace mode for the container. options are "pick","auto","host","private"
# pick is analog to systemd nspawn and computes starting host_uid based on the container name hash
userns: auto
# systemd options
systemd:
# systemd restart: "no, on-failure, on-success, on-abnormal, on-watchdog, on-abort, or always"
restart: "on-failure"
# after, requires, wants: equal to systemd config
after: ""
requires: ""
wants: ""
# additional systemd properties for the [service] section
service: {}
# additional systemd properties for the [unit] section
unit: {}
# desktop options
desktop:
template: default
options: []
entry:
Type: Application
# # https://specifications.freedesktop.org/desktop-entry-spec/latest/
# environment: dict: add environment data: {key: value,}
environment: {}
# compose source config
source: ""
# compose overrides: dict: define or override config from source
config: {}
# files to be placed inside workdir
files: {}
{# Examples: see container_defaults #}
# run before the service is started the first time
init:
command: ""
environment: {}
# run after updating the corresponding image to a newer image before starting the service
change:
command: ""
environment: {}
{% endload %}