2022-07-21 01:00:17 +02:00
|
|
|
[Unit]
|
|
|
|
Description=Nomad
|
|
|
|
Documentation=https://nomadproject.io/docs/
|
|
|
|
Wants=network-online.target
|
|
|
|
After=network-online.target
|
2022-07-29 15:00:16 +02:00
|
|
|
ConditionFileNotEmpty={{ nomad_root_dir }}/etc/nomad.hcl
|
2022-07-21 01:00:17 +02:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
EnvironmentFile=-{{ nomad_root_dir }}/etc/nomad.env
|
2022-09-04 18:00:17 +02:00
|
|
|
{% if nomad_conf.consul.ssl and nomad_conf.client.enabled %}
|
|
|
|
Environment=CONSUL_HTTP_SSL=true
|
|
|
|
Environment=CONSUL_HTTP_ADDR=localhost:{{ (consul_services is defined) | ternary(consul_services.https.port, '8501') }}
|
|
|
|
Environment=CONSUL_CACERT={{ nomad_conf.consul.ca_file }}
|
|
|
|
Environment=CONSUL_CLIENT_CERT={{ nomad_conf.consul.cert_file }}
|
|
|
|
Environment=CONSUL_CLIENT_KEY={{ nomad_conf.consul.key_file }}
|
|
|
|
{% endif %}
|
2022-07-21 01:00:17 +02:00
|
|
|
User={{ nomad_user }}
|
|
|
|
Group={{ nomad_user }}
|
2022-08-09 13:00:15 +02:00
|
|
|
ExecStart={{ nomad_root_dir }}/bin/nomad agent -config={{ nomad_root_dir }}/etc/
|
2022-07-21 01:00:17 +02:00
|
|
|
ExecReload=/bin/kill --signal HUP $MAINPID
|
2022-08-01 18:00:23 +02:00
|
|
|
SuccessExitStatus=1
|
2022-07-21 01:00:17 +02:00
|
|
|
Restart=on-failure
|
|
|
|
LimitNOFILE=65536
|
|
|
|
LimitNPROC=infinity
|
2022-08-01 11:00:15 +02:00
|
|
|
Restart=on-failure
|
2022-07-21 01:00:17 +02:00
|
|
|
RestartSec=2
|
|
|
|
TasksMax=infinity
|
|
|
|
OOMScoreAdjust=-1000
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|