#!/bin/bash # Nomad Bootstrap Script # Params: # client : bootstraps as client # exit on error set -e # create nomad dir mkdir -p /opt/nomad nomaduser=nomad nomadgroup=nomad if [ "$#" -eq 1 ] && [ "$1" == "-client" ]; then echo "bootstraping as nomad client" nomaduser=root nomadgroup=root fi # create config dir mkdir -p /etc/nomad.d && chmod 700 /etc/nomad.d # write common nomad config cat >/etc/nomad.d/nomad.hcl </etc/systemd/system/nomad.service </etc/nomad.d/server.hcl </etc/nomad.d/client.hcl <