mirror of
https://github.com/natelandau/ansible-homelab-config.git
synced 2025-11-18 09:53:41 -05:00
Nomad is running as root rather than the Nomad user due to the Docker driver not being started when cgroups v2 are enabled. More info: https://github.com/hashicorp/nomad/pull/16063
33 lines
788 B
Django/Jinja
33 lines
788 B
Django/Jinja
[Unit]
|
|
Description=Nomad
|
|
Documentation=https://nomadproject.io/docs/
|
|
Wants=network-online.target
|
|
After=network-online.target
|
|
ConditionFileNotEmpty={{ nomad_configuration_dir }}/nomad.hcl
|
|
|
|
[Service]
|
|
{# {% if 'linode' in group_names %} #}
|
|
{# User=nomad #}
|
|
{# Group=nomad #}
|
|
{# {% endif %} #}
|
|
|
|
{# NOTE: Nomad is running as root rather than the Nomad user due to the Docker driver not being started when cgroups v2 are enabled.
|
|
|
|
https://github.com/hashicorp/nomad/pull/16063
|
|
#}
|
|
User=root
|
|
Group=root
|
|
ExecReload=/bin/kill -HUP $MAINPID
|
|
ExecStart=/usr/local/bin/nomad agent -config {{ nomad_configuration_dir }}
|
|
KillMode=process
|
|
KillSignal=SIGINT
|
|
LimitNOFILE=infinity
|
|
LimitNPROC=infinity
|
|
Restart=on-failure
|
|
RestartSec=2
|
|
StartLimitBurst=3
|
|
TasksMax=infinity
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|