Yet another web developer blog

Quick way to install SaltStack minion on Debian / Ubuntu Linux

Here is bash commands to quickly install salt-minion to Ubuntu / Debian systems:

MASTER=salt.SERVER.COM
BRAND=murz
HOSTNAME=hostname.SERVER.COM

hostnamectl set-hostname $HOSTNAME
DISTRIBUTIVE=`lsb_release -is`
#Lower casing of ditributive name
DISTRIBUTIVE=${DISTRIBUTIVE,,}
RELEASE=`lsb_release -rs`
CODENAME=`lsb_release -cs`

apt install gnupg;

wget -O - https://repo.saltstack.com/py3/$DISTRIBUTIVE/$RELEASE/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add - ;
echo "deb http://repo.saltstack.com/py3/$DISTRIBUTIVE/$RELEASE/amd64/latest $CODENAME main" > /etc/apt/sources.list.d/saltstack.list;
apt update; apt install salt-minion -y

echo "master: $MASTER
" > /etc/salt/minion.d/$BRAND.conf

echo "$HOSTNAME" > /etc/salt/minion_id

service salt-minion restart