2016-06-16 09:48:51 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-06-16 10:19:27 +00:00
|
|
|
custom_opts='--ansible-opts=\"-e kargo/custom.yaml\"'
|
2016-06-16 09:48:51 +00:00
|
|
|
nodes=""
|
|
|
|
|
|
|
|
i=0
|
|
|
|
for nodeip in `cat /root/nodes` ; do
|
|
|
|
i=$(( $i+1 ))
|
|
|
|
nodes+=" node${i}[ansible_ssh_host=${nodeip},ip=${nodeip}]"
|
|
|
|
done
|
|
|
|
|
2016-06-16 10:19:27 +00:00
|
|
|
if [ -f kargo/inventory/inventory.cfg ] ; then
|
|
|
|
echo "kargo/inventory/inventory.cfg already exists, if you want to recreate, pls remove it and re-run this script"
|
|
|
|
else
|
|
|
|
echo "Preparing inventory..."
|
|
|
|
kargo prepare -y --nodes $nodes
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Running deployment..."
|
2016-06-16 09:48:51 +00:00
|
|
|
deploy_res=$?
|
|
|
|
|
|
|
|
if [ "$deploy_res" -eq "0" ]; then
|
|
|
|
echo "Setting up kubedns..."
|
|
|
|
kpm deploy kube-system/kubedns --namespace=kube-system
|
|
|
|
fi
|