create a XTesting directory to first add the required files for a RIC platform deploy...
[it/test.git] / XTesting / kubeadm / deploy.sh
diff --git a/XTesting/kubeadm/deploy.sh b/XTesting/kubeadm/deploy.sh
new file mode 100644 (file)
index 0000000..198f69e
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash -x
+
+#cp -rfp inventory/sample inventory/oransc-cluster
+. sample_env
+declare -a IPS=($ANSIBLE_HOST_IP)
+CONFIG_FILE=hosts.yaml python3 inventory.py ${IPS[@]}
+export ANSIBLE_HOST_KEY_CHECKING=False
+ansible-playbook -i hosts.yaml --become --private-key ${ANSIBLE_SSH_KEY} cluster.yml
+
+#sshpass -p $ANSIBLE_PASSWORD scp -o StrictHostKeyChecking=no -i ${ANSIBLE_SSH_KEY} -q root@$ANSIBLE_HOST_IP:/root/.kube/config ${PROJECT_ROOT}/config
+scp -o StrictHostKeyChecking=no -i ${ANSIBLE_SSH_KEY} -q root@$ANSIBLE_HOST_IP:/root/.kube/config ${PROJECT_ROOT}/config
+sed -i "s/127.0.0.1/${ANSIBLE_HOST_IP}/g" "${PROJECT_ROOT}"/config