initialize

This commit is contained in:
Elouin 2024-11-10 14:34:49 +01:00
commit 154ddca3ba
6 changed files with 55 additions and 0 deletions

17
voxelibre/init.sls Normal file
View file

@ -0,0 +1,17 @@
voxelibre-volume-file-is-present:
file.managed:
- name: /etc/containers/systemd/voxelibre.volume
- source: salt://voxelibre/voxelibre.volume.jinja
- template: jinja
voxelibre-container-file-is-present:
file.managed:
- name: /etc/containers/systemd/voxelibre.container
- source: salt://voxelibre/voxelibre.container.jinja
- template: jinja
reload-systemd-units-onchange-of-voxelibre-container-unit-file:
module.run:
- service.systemctl_reload
- onchanges:
- file: /etc/containers/systemd/voxelibre.container

View file

@ -0,0 +1,16 @@
[Unit]
Description=VoxeLibre Server
[Container]
Image={{ salt['pillar.get']('voxelibre:image:path', 'codeberg.org/elouin/voxelibre') }}:{{ salt['pillar.get']('voxelibre:image:version', '0.87.2-1') }}
Volume=voxelibre.volume:/var/lib/minetest/.minetest/worlds
PublishPort={{ salt['pillar.get']('voxelibre:port', "30000") }}:30000/udp
{% for option, value in pillar.get('voxelibre:config', {}).items() %}
Environment={{ option }}={{ value }}
{% endfor %}
[Service]
TimeoutStartSec=900
[Install]
WantedBy=multi-user.target default.target

View file

@ -0,0 +1,2 @@
[Volume]
VolumeName=voxelibre-world