This repository has been archived by the owner on Jan 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
nomad-common-clc.yaml
71 lines (64 loc) · 2.04 KB
/
nomad-common-clc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
passwd:
users:
- name: core
ssh_authorized_keys:
- "%%SSH_PUBKEY%%"
systemd:
units:
- name: "prepare-nomad-binary.service"
enabled: true
contents: |
[Unit]
Description=Unpack Nomad binary to /opt/bin
ConditionPathExists=!/opt/bin/nomad
[Service]
Type=oneshot
Restart=on-failure
RemainAfterExit=yes
Environment=NOMAD_VERSION=1.2.6
ExecStart=/usr/bin/unzip "/opt/bin/nomad_${NOMAD_VERSION}_linux_amd64.zip" -d /opt/bin
ExecStart=/usr/bin/rm "/opt/bin/nomad_${NOMAD_VERSION}_linux_amd64.zip"
[Install]
WantedBy=multi-user.target
- name: "prepare-consul-binary.service"
enabled: true
contents: |
[Unit]
Description=Unpack Consul binary to /opt/bin
ConditionPathExists=!/opt/bin/consul
[Service]
Type=oneshot
Restart=on-failure
RemainAfterExit=yes
Environment=CONSUL_VERSION=1.11.2
ExecStart=/usr/bin/unzip "/opt/bin/consul_${CONSUL_VERSION}_linux_amd64.zip" -d /opt/bin
ExecStart=/usr/bin/rm "/opt/bin/consul_${CONSUL_VERSION}_linux_amd64.zip"
[Install]
WantedBy=multi-user.target
- name: "nomad-agent.service"
enabled: true
contents: |
[Unit]
Description=Nomad
Documentation=https://www.nomadproject.io/docs/
After=network-online.target prepare-nomad-binary.service
Wants=network-online.target
Requires=prepare-nomad-binary.service
# 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]
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/opt/bin/nomad agent -config /etc/nomad.d
KillMode=process
KillSignal=SIGINT
LimitNOFILE=65536
LimitNPROC=infinity
Restart=on-failure
RestartSec=2
TasksMax=infinity
OOMScoreAdjust=-1000
[Install]
WantedBy=multi-user.target