mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
[Main] Onboard to CRT (#12276)
This commit is contained in:
0
.release/linux/package/etc/nomad.d/nomad.env
Normal file
0
.release/linux/package/etc/nomad.d/nomad.env
Normal file
16
.release/linux/package/etc/nomad.d/nomad.hcl
Normal file
16
.release/linux/package/etc/nomad.d/nomad.hcl
Normal file
@@ -0,0 +1,16 @@
|
||||
# Full configuration options can be found at https://www.nomadproject.io/docs/configuration
|
||||
|
||||
data_dir = "/opt/nomad/data"
|
||||
bind_addr = "0.0.0.0"
|
||||
|
||||
server {
|
||||
# license_path is required as of Nomad v1.1.1+
|
||||
#license_path = "/etc/nomad.d/nomad.hcl"
|
||||
enabled = true
|
||||
bootstrap_expect = 1
|
||||
}
|
||||
|
||||
client {
|
||||
enabled = true
|
||||
servers = ["127.0.0.1"]
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
[Unit]
|
||||
Description=Nomad
|
||||
Documentation=https://nomadproject.io/docs/
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
# 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]
|
||||
EnvironmentFile=-/etc/nomad.d/nomad.env
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
ExecStart=/usr/bin/nomad agent -config /etc/nomad.d
|
||||
KillMode=process
|
||||
KillSignal=SIGINT
|
||||
LimitNOFILE=65536
|
||||
LimitNPROC=infinity
|
||||
Restart=on-failure
|
||||
RestartSec=2
|
||||
|
||||
## Configure unit start rate limiting. Units which are started more than
|
||||
## *burst* times within an *interval* time span are not permitted to start any
|
||||
## more. Use `StartLimitIntervalSec` or `StartLimitInterval` (depending on
|
||||
## systemd version) to configure the checking interval and `StartLimitBurst`
|
||||
## to configure how many starts per interval are allowed. The values in the
|
||||
## commented lines are defaults.
|
||||
|
||||
# StartLimitBurst = 5
|
||||
|
||||
## StartLimitIntervalSec is used for systemd versions >= 230
|
||||
# StartLimitIntervalSec = 10s
|
||||
|
||||
## StartLimitInterval is used for systemd versions < 230
|
||||
# StartLimitInterval = 10s
|
||||
|
||||
TasksMax=infinity
|
||||
OOMScoreAdjust=-1000
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
16
.release/linux/postinst
Normal file
16
.release/linux/postinst
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
mkdir -p /opt/nomad/data
|
||||
chown nomad:nomad /opt/nomad/data
|
||||
chown -R nomad:nomad /etc/nomad.d
|
||||
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
fi
|
||||
|
||||
if [[ $(nomad version) == *+ent* ]]; then
|
||||
echo "
|
||||
The following shall apply unless your organization has a separately signed Enterprise License Agreement or Evaluation Agreement governing your use of the software:
|
||||
Software in this repository is subject to the license terms located in the software, copies of which are also available at https://eula.hashicorp.com/ClickThruELA-Global.pdf or https://www.hashicorp.com/terms-of-evaluation as applicable. Please read the license terms prior to using the software. Your installation and use of the software constitutes your acceptance of these terms. If you do not accept the terms, do not use the software.
|
||||
"
|
||||
fi
|
||||
7
.release/linux/postrm
Normal file
7
.release/linux/postrm
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$1" = "purge" ]; then
|
||||
userdel nomad
|
||||
fi
|
||||
|
||||
exit 0
|
||||
13
.release/linux/preinst
Normal file
13
.release/linux/preinst
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
USER="nomad"
|
||||
|
||||
if ! id -u $USER >/dev/null 2>&1; then
|
||||
useradd \
|
||||
--system \
|
||||
--user-group \
|
||||
--shell /bin/false \
|
||||
$USER
|
||||
fi
|
||||
Reference in New Issue
Block a user