Last active
March 26, 2018 15:54
-
-
Save fortyfivan/3b22cde2ad764363091f14e7648574ea to your computer and use it in GitHub Desktop.
EC2 user data script for enrolling a server to ScaleFT
This file contains 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 | |
echo "Add an enrollment token" | |
sudo mkdir -p /var/lib/sftd | |
# get enrollment token from app.scaleft.com | |
echo "ENROLLMENT TOKEN" | sudo tee /var/lib/sftd/enrollment.token | |
# enter an altname for the server | |
echo "Add a basic sftd configuration" | |
sudo mkdir -p /etc/sft/ | |
sftcfg=$(cat <<EOF | |
--- | |
AltNames: ["ALTNAME"] | |
EOF | |
) | |
echo -e "$sftcfg" | sudo tee /etc/sft/sftd.yaml | |
export DEBIAN_FRONTEND=noninteractive | |
echo "Add the ScaleFT apt repo to your /etc/apt/sources.list system config file" | |
echo "deb https://pkg.scaleft.com/deb linux main" | sudo tee -a /etc/apt/sources.list | |
echo "Trust the repository signing key" | |
curl -C - https://dist.scaleft.com/pki/scaleft_deb_key.asc | sudo apt-key add - | |
echo "Retrieve information about new packages" | |
sudo apt-get update | |
echo "Install sftd" | |
sudo apt-get install scaleft-server-tools |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment