[Unit]
Description="HashiCorp consul-template"
Documentation=https://github.com/hashicorp/consul-template
Requires=network-online.target
After=network-online.target
Before=nomad.service
ConditionFileNotEmpty={{ nomad_root_dir }}/consul-template/consul-template.hcl

[Service]
Type=simple
ExecStart=/usr/local/bin/consul-template -config={{ nomad_root_dir }}/consul-template/consul-template.hcl
SuccessExitStatus=12
ExecReload=/bin/kill --signal HUP $MAINPID
KillSignal=SIGINT
Restart=on-failure
RestartSec=2

[Install]
WantedBy=multi-user.target

