2016-06-14 16:21:56 +00:00
|
|
|
#!/bin/bash
|
|
|
|
echo master > /var/tmp/role
|
|
|
|
|
2016-06-16 09:48:51 +00:00
|
|
|
# Packages
|
2016-06-14 16:21:56 +00:00
|
|
|
sudo apt-get --yes update
|
|
|
|
sudo apt-get --yes upgrade
|
2016-06-16 09:48:51 +00:00
|
|
|
sudo apt-get --yes install ansible git screen vim telnet tcpdump python-setuptools gcc python-dev python-pip libssl-dev libffi-dev software-properties-common
|
|
|
|
|
|
|
|
# Kargo and custom inventory
|
2016-06-14 16:21:56 +00:00
|
|
|
sudo git clone https://github.com/kubespray/kargo /root/kargo
|
2016-06-14 17:04:09 +00:00
|
|
|
sudo git clone https://github.com/adidenko/vagrant-k8s /root/vagrant-k8s
|
2016-06-14 17:10:20 +00:00
|
|
|
sudo cp -a /root/vagrant-k8s/kargo/inv /root/kargo/inv
|
2016-06-14 16:21:56 +00:00
|
|
|
|
2016-06-16 09:48:51 +00:00
|
|
|
# Kargo-cli
|
|
|
|
sudo git clone https://github.com/kubespray/kargo-cli.git /root/kargo-cli
|
|
|
|
sudo sh -c 'cd /root/kargo-cli && python setup.py install'
|
|
|
|
|
|
|
|
# Pip
|
|
|
|
sudo pip install kpm
|
|
|
|
|
|
|
|
# k8s deploy script and config
|
|
|
|
sudo sh -c 'cp -a ~/deploy-k8s.kargo.sh /root/ && chmod 755 /root/deploy-k8s.kargo.sh'
|
|
|
|
sudo cp -a ~/custom.yaml /root/kargo/custom.yaml
|
|
|
|
|
|
|
|
# SSH keys and config
|
2016-06-14 16:21:56 +00:00
|
|
|
sudo rm -rf /root/.ssh
|
|
|
|
sudo mv ~vagrant/ssh /root/.ssh
|
2016-06-14 16:30:30 +00:00
|
|
|
sudo echo -e 'Host 10.210.*\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile=/dev/null' >> /root/.ssh/config
|
2016-06-14 16:21:56 +00:00
|
|
|
sudo chown -R root: /root/.ssh
|
2016-06-15 09:48:50 +00:00
|
|
|
|
2016-06-16 09:48:51 +00:00
|
|
|
# Save nodes list
|
|
|
|
sudo cp ~/nodes /root/nodes
|
|
|
|
|
|
|
|
# README
|
2016-06-15 09:48:50 +00:00
|
|
|
sudo echo 'cd /root/kargo ; ansible-playbook -vvv -i inv/inventory.cfg cluster.yml -u root -f 7' > /root/README
|