|
|
@ -56,6 +56,7 @@ cat >/etc/nomad.d/nomad.hcl <<EOF
|
|
|
|
datacenter = "dc1"
|
|
|
|
datacenter = "dc1"
|
|
|
|
data_dir = "/opt/nomad"
|
|
|
|
data_dir = "/opt/nomad"
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
|
|
|
|
chown nomad:nomad /etc/nomad.d/nomad.hcl
|
|
|
|
|
|
|
|
|
|
|
|
if [ $nomaduser == "nomad" ]; then
|
|
|
|
if [ $nomaduser == "nomad" ]; then
|
|
|
|
|
|
|
|
|
|
|
@ -65,8 +66,11 @@ server {
|
|
|
|
enabled = true
|
|
|
|
enabled = true
|
|
|
|
bootstrap_expect = 1
|
|
|
|
bootstrap_expect = 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ui {
|
|
|
|
|
|
|
|
enabled = true
|
|
|
|
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
|
|
|
|
chown nomad:nomad /etc/nomad.d/server.hcl
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
|
|
# write client config
|
|
|
|
# write client config
|
|
|
@ -75,13 +79,11 @@ client {
|
|
|
|
enabled = true
|
|
|
|
enabled = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
|
|
|
|
chown nomad:no
|
|
|
|
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# reload systemd
|
|
|
|
# reload systemd
|
|
|
|
systemctl daemon-reload
|
|
|
|
systemctl daemon-reload
|
|
|
|
|
|
|
|
|
|
|
|
# enable and start service
|
|
|
|
echo "Done! Run systemctl start to use nomad."
|
|
|
|
systemctl enable --now nomad.service
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Done! Nomad service enabled and started."
|
|
|
|
|
|
|
|