11c9f78d8fe0aaf0ab5554b58678f9bc0de09d49
[it/test.git] / XTesting / kubespray / scripts / deploy.sh
1 #!/bin/bash
2
3 cp -rfp inventory/sample inventory/oransc-cluster
4 . sample_env
5 declare -a IPS=($ANSIBLE_HOST_IP)
6 CONFIG_FILE=inventory/oransc-cluster/hosts.yaml python3 contrib/inventory_builder/inventory.py ${IPS[@]}
7 ansible-playbook -i inventory/oransc-cluster/hosts.yaml --become --private-key inventory/oransc-cluster/id_rsa cluster.yml
8
9 #sshpass -p $ANSIBLE_PASSWORD scp -o StrictHostKeyChecking=no -i inventory/oransc-cluster/id_rsa -q root@$ANSIBLE_HOST_IP:/root/.kube/config ${PROJECT_ROOT}/config
10 scp -o StrictHostKeyChecking=no -i inventory/oransc-cluster/id_rsa -q root@$ANSIBLE_HOST_IP:/root/.kube/config ${PROJECT_ROOT}/config
11 sed -i "s/127.0.0.1/${ANSIBLE_HOST_IP}/g" "${PROJECT_ROOT}"/config