Skip to content

Instantly share code, notes, and snippets.

@r7vme
Last active April 12, 2017 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r7vme/301cc37f021c44f9be7b0d1436cdfacf to your computer and use it in GitHub Desktop.
Save r7vme/301cc37f021c44f9be7b0d1436cdfacf to your computer and use it in GitHub Desktop.
#!/bin/bash
NODE_NAME=$(hostname -f)
CONFIG_HOST=10.8.0.4
echo "Preparing base OS ..."
which wget >/dev/null || (apt-get update; apt-get install -y wget)
echo "deb [arch=amd64] http://apt.tcpcloud.eu/nightly/ xenial main security extra tcp tcp-salt" > /etc/apt/sources.list
wget -O - http://apt.tcpcloud.eu/public.gpg | apt-key add -
echo "deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3 xenial main" > /etc/apt/sources.list.d/saltstack.list
wget -O - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3/SALTSTACK-GPG-KEY.pub | apt-key add -
apt-get clean
apt-get update
apt-get install -y salt-minion
echo "id: $NODE_NAME" >> /etc/salt/minion
echo "master: $CONFIG_HOST" >> /etc/salt/minion
rm -f /etc/salt/pki/minion/minion_master.pub
service salt-minion restart
echo "Showing node metadata..."
salt-call --no-color pillar.data
#echo "Running complete state ..."
#salt-call --no-color state.sls linux,openssh,salt -l info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment