mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-04-16 02:03:09 +02:00
33 lines
1.0 KiB
Django/Jinja
33 lines
1.0 KiB
Django/Jinja
[Unit]
|
|
Description=Nomad
|
|
Documentation=https://nomadproject.io/docs/
|
|
Wants=network-online.target
|
|
After=network-online.target
|
|
ConditionFileNotEmpty={{ nomad_root_dir }}/etc/nomad.hcl
|
|
|
|
[Service]
|
|
EnvironmentFile=-{{ nomad_root_dir }}/etc/nomad.env
|
|
{% 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 %}
|
|
User={{ nomad_user }}
|
|
Group={{ nomad_user }}
|
|
ExecStart={{ nomad_root_dir }}/bin/nomad agent -config={{ nomad_root_dir }}/etc/
|
|
ExecReload=/bin/kill --signal HUP $MAINPID
|
|
SuccessExitStatus=1
|
|
Restart=on-failure
|
|
LimitNOFILE=65536
|
|
LimitNPROC=infinity
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
StartLimitInterval=0
|
|
TasksMax=infinity
|
|
OOMScoreAdjust=-1000
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|