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-20 07:58:09 +00:00
|
|
|
sudo apt-get --yes install git screen vim telnet tcpdump python-setuptools gcc python-dev python-pip libssl-dev libffi-dev software-properties-common
|
|
|
|
|
|
|
|
# Get ansible-2.1+, vanilla ubuntu-16.04 ansible (2.0.0.2) is broken due to https://github.com/ansible/ansible/issues/13876
|
|
|
|
sudo sh -c 'apt-add-repository -y ppa:ansible/ansible;apt-get update;apt-get install -y ansible'
|
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'
|
|
|
|
|
2016-06-20 10:02:25 +00:00
|
|
|
# k8s deploy script and configs
|
2016-06-16 09:51:28 +00:00
|
|
|
sudo sh -c 'cp -a ~vagrant/deploy-k8s.kargo.sh /root/ && chmod 755 /root/deploy-k8s.kargo.sh'
|
2016-06-20 09:05:17 +00:00
|
|
|
sudo cp -a ~vagrant/custom.yaml /root/custom.yaml
|
2016-06-20 10:02:25 +00:00
|
|
|
sudo cp -a ~vagrant/kubedns.yaml /root/kubedns.yaml
|
2016-06-16 09:48:51 +00:00
|
|
|
|
|
|
|
# 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-16 12:28:16 +00:00
|
|
|
sudo echo -e 'Host 10.*\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:51:28 +00:00
|
|
|
# Copy nodes list
|
|
|
|
sudo cp ~vagrant/nodes /root/nodes
|
2016-06-16 09:48:51 +00:00
|
|
|
|
|
|
|
# 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
|