Created
October 31, 2017 23:15
-
-
Save kmassada/38c3bd5b096c4c0a6963c0a7b572b262 to your computer and use it in GitHub Desktop.
Re-install GCP services for your nodes
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 | |
declare -a PKG_LIST=(google-cloud-packages-archive-keyring \ | |
google-compute-engine google-compute-engine-oslogin \ | |
python-google-compute-engine python3-google-compute-engine) | |
declare -x APT_SERVER="packages.cloud.google.com" | |
curl https://$APT_SERVER/apt/doc/apt-key.gpg | apt-key add - | |
DEB_DIST=$(cat /etc/os-release | grep "VERSION=" \ | |
| sed "s/\"\|(\|)\|VERSION=//g" | awk '{print tolower($NF)}') | |
tee /etc/apt/sources.list.d/google-cloud.list << EOM | |
deb http://$APT_SERVER/apt google-compute-engine-${DEB_DIST}-stable main | |
deb http://$APT_SERVER/apt google-cloud-packages-archive-keyring-${DEB_DIST} main | |
EOM | |
apt-get update | |
for pkg in ${PKG_LIST[@]}; do | |
echo "Running apt install $pkg..." | |
apt install -y $pkg | |
done | |
reboot now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment