aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.ansible/roles/nomad/templates/nomad_systemd.service.j2
diff options
context:
space:
mode:
Diffstat (limited to 'fdio.infra.ansible/roles/nomad/templates/nomad_systemd.service.j2')
-rw-r--r--fdio.infra.ansible/roles/nomad/templates/nomad_systemd.service.j233
1 files changed, 33 insertions, 0 deletions
diff --git a/fdio.infra.ansible/roles/nomad/templates/nomad_systemd.service.j2 b/fdio.infra.ansible/roles/nomad/templates/nomad_systemd.service.j2
new file mode 100644
index 0000000000..564505781b
--- /dev/null
+++ b/fdio.infra.ansible/roles/nomad/templates/nomad_systemd.service.j2
@@ -0,0 +1,33 @@
+[Unit]
+Description=Nomad
+Documentation=https://nomadproject.io/docs/
+Wants=network-online.target
+After=network-online.target
+
+# When using Nomad with Consul it is not necessary to start Consul first. These
+# lines start Consul before Nomad as an optimization to avoid Nomad logging
+# that Consul is unavailable at startup.
+#Wants=consul.service
+#After=consul.service
+
+[Service]
+# Nomad server should be run as the nomad user. Nomad clients
+# should be run as root
+#User=nomad
+#Group=nomad
+
+ExecReload=/bin/kill -HUP $MAINPID
+ExecStart={{ nomad_bin_dir }}/nomad agent -config {{ nomad_config_dir }}
+KillMode=process
+KillSignal=SIGINT
+LimitNOFILE=infinity
+LimitNPROC=infinity
+Restart=on-failure
+RestartSec=2
+StartLimitBurst=3
+StartLimitInterval=10
+TasksMax=infinity
+OOMScoreAdjust=-1000
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file