Infra: Ansible Nomad
[csit.git] / resources / tools / testbed-setup / ansible / roles / nomad / templates / nomad_systemd.service.j2
diff --git a/resources/tools/testbed-setup/ansible/roles/nomad/templates/nomad_systemd.service.j2 b/resources/tools/testbed-setup/ansible/roles/nomad/templates/nomad_systemd.service.j2
new file mode 100644 (file)
index 0000000..d0beed2
--- /dev/null
@@ -0,0 +1,18 @@
+[Unit]
+Description=nomad agent
+Wants=network.target
+After=nomad.service
+
+[Service]
+# TODO: Decrease privilege
+User=root
+Group=root
+Environment="GOMAXPROCS=2"
+ExecStart={{ nomad_bin_dir }}/nomad agent -config={{ nomad_config_dir }}
+ExecReload=/bin/kill -9 $MAINPID
+KillSignal=SIGTERM
+Restart=on-failure
+RestartSec=1
+
+[Install]
+WantedBy=default.target