Last active
May 31, 2022 12:56
-
-
Save zhiguangwang/6be1a81d4eb6b176627a7e6ca9c603af to your computer and use it in GitHub Desktop.
Install salt-minion on Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
SALT_VERSION='3002' | |
if [ -z "$1" ]; then | |
echo 'Please run this script with argument <salt-master address>' | |
exit 1 | |
fi | |
SALT_MASTER=$1 | |
readonly os_release=$(lsb_release -rs) | |
readonly os_codename=$(lsb_release -cs) | |
sudo curl -fsSL -o /usr/share/keyrings/salt-archive-keyring.gpg https://repo.saltproject.io/py3/ubuntu/${os_release}/amd64/${SALT_VERSION}/salt-archive-keyring.gpg | |
sudo tee "/etc/apt/sources.list.d/saltstack.list" << EOF | |
deb [arch=amd64 signed-by=/usr/share/keyrings/salt-archive-keyring.gpg] https://repo.saltproject.io/py3/ubuntu/${os_release}/amd64/${SALT_VERSION} ${os_codename} main | |
EOF | |
sudo apt update && sudo apt install salt-minion -y | |
echo "master: ${SALT_MASTER}" | sudo tee /etc/salt/minion.d/99-master-address.conf | |
sudo systemctl restart salt-minion.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment