commit 154ddca3bafbb80bbc7431c56a2c103fd2e14ae5 Author: Elouin Date: Sun Nov 10 14:34:49 2024 +0100 initialize diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..480e474 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +cachedir/ +etc/ +log.txt +.bundle/ +.kitchen/ +vendor/ +Gemfile.lock +venv/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..9d9751a --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# VoxeLibre Formula + +This is a saltstack formula to deploy a VoxeLibre server via podman quadlet. diff --git a/pillar.example b/pillar.example new file mode 100644 index 0000000..d7a215a --- /dev/null +++ b/pillar.example @@ -0,0 +1,9 @@ +voxelibre: + port: 30000 + image: + path: codeberg.org/elouin/voxelibre + version: 0.87.2-1 + config: + PORT: 1337 + SERVER_NAME: Super VoxeLibre server + MOTD: This server was deployed with the voxelibre formula diff --git a/voxelibre/init.sls b/voxelibre/init.sls new file mode 100644 index 0000000..c405cc0 --- /dev/null +++ b/voxelibre/init.sls @@ -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 diff --git a/voxelibre/voxelibre.container.jinja b/voxelibre/voxelibre.container.jinja new file mode 100644 index 0000000..a493a45 --- /dev/null +++ b/voxelibre/voxelibre.container.jinja @@ -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 diff --git a/voxelibre/voxelibre.volume.jinja b/voxelibre/voxelibre.volume.jinja new file mode 100644 index 0000000..29ac7b7 --- /dev/null +++ b/voxelibre/voxelibre.volume.jinja @@ -0,0 +1,2 @@ +[Volume] +VolumeName=voxelibre-world