Last active
September 28, 2019 03:38
-
-
Save tomoyk/e7b2f15fd81bf2caf2cce7f2204e7ad3 to your computer and use it in GitHub Desktop.
ansible書くほどでもない時に使える流し込みスクリプト
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 | |
host_list=`cat <<EOF | |
bootcamp-vm-25 | |
bootcamp-vm-49 | |
bootcamp-vm-5 | |
bootcamp-vm-8 | |
bootcamp-vm-62 | |
bootcamp-vm-10 | |
bootcamp-vm-15 | |
bootcamp-vm-82 | |
bootcamp-vm-28 | |
bootcamp-vm-5 | |
bootcamp-vm-0 | |
bootcamp-vm-13 | |
EOF` | |
for host in $host_list | |
do | |
sshpass -p "HOGEHOGE" ssh -o "StrictHostKeyChecking no" guest@${host}.example.com <<EOC | |
echo "HOGEHOGE" | sudo -S hostname | |
# Python | |
sudo apt -y update | |
sudo apt -y upgrade | |
sudo apt -y install python3-venv | |
# Docker | |
sudo apt -y remove docker docker-engine docker.io containerd runc | |
sudo apt -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt -y update | |
sudo apt -y install docker-ce docker-ce-cli containerd.io | |
sudo systemctl enable docker | |
# Minikube | |
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_1.3.1.deb && sudo dpkg -i minikube_1.3.1.deb | |
sudo minikube config set vm-driver none | |
sudo minikube start --vm-driver=none | |
# kubectl | |
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl | |
chmod +x ./kubectl | |
sudo mv ./kubectl /usr/local/bin/kubectl | |
sudo minikube start | |
sudo chown -R cdsl: .kube/ .minikube/ | |
EOC | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment