nomad: add initial jobspec
Some checks are pending
continuous-integration/laminar-eldarion Build failed with exit code 123 after 2 seconds

This commit is contained in:
Starbeamrainbowlabs 2022-05-01 02:29:49 +01:00
parent 61463167dd
commit e0f5321932
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 37 additions and 0 deletions

18
src/steps-config/80-nomad.sh Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
nomad_mode="$(ask_multichoice "Nomad installation mode" "none" "client" "server" "both")";
if [[ "${nomad_mode}" != "none" ]]; then
queue_apt_install "hashicorp-nomad";
case "${nomad_mode}" in
client )
queue_apt_install "hashicorp-nomad-systemd-client";
;;
server )
queue_apt_install "hashicorp-nomad-systemd-server";
;;
both )
queue_apt_install "hashicorp-nomad-systemd-both";
;;
esac
fi

View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
task_begin "Installing Nomad configuration";
# /etc/nomad is created by the apt postinstall script
subtask_begin "Copying configuration files";
cp "configs/nomad-client.hcl" "/etc/nomad/client.hcl";
cp "configs/nomad-server.hcl" "/etc/nomad/server.hcl";
cp "configs/nomad-both.hcl" "/etc/nomad/both.hcl";
subtask_end "$?";
# No UFW rules required, as we're now using wesher/wireguard, and allowing all inbound traffic on that interface
subtask_begin "Starting Nomad and enabling on boot";
systemctl enable --now nomad;
subtask_end "$?";
task_end "$?";