From 154ddca3bafbb80bbc7431c56a2c103fd2e14ae5 Mon Sep 17 00:00:00 2001 From: Elouin Date: Sun, 10 Nov 2024 14:34:49 +0100 Subject: [PATCH] initialize --- .gitignore | 8 ++++++++ README.md | 3 +++ pillar.example | 9 +++++++++ voxelibre/init.sls | 17 +++++++++++++++++ voxelibre/voxelibre.container.jinja | 16 ++++++++++++++++ voxelibre/voxelibre.volume.jinja | 2 ++ 6 files changed, 55 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 pillar.example create mode 100644 voxelibre/init.sls create mode 100644 voxelibre/voxelibre.container.jinja create mode 100644 voxelibre/voxelibre.volume.jinja 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