setup.sh 628 Bytes
Newer Older
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
if [ $# -lt 1 ]; then
  echo 1>&2 "$0: not enough arguments"
  exit 2
elif [ $# -gt 1 ]; then
  echo 1>&2 "$0: too many arguments"
  exit 2
fi

RNA_NAME=$1

apt update && apt upgrade -y && apt autoremove -y

apt install -y \
    salt-minion

echo "$RNA_NAME" > /etc/salt/minion_id
echo "master: 10.8.0.1" > /etc/salt/minion.d/master.conf
service salt-minion restart

sed -i -e "s/odroid/$RNA_NAME/g"  /etc/hostname
sed -i -e "s/odroid/$RNA_NAME/g"  /etc/hosts
salt-call test.ping
echo "Press any key to continue."
read -n 1 -s
salt-call test.ping

salt-call state.highstate
salt-call state.sls tools
29
salt-call state.sls network