pceicicd | a1d10ac | 2022-11-10 23:59:17 +0000 | [diff] [blame] | 1 | #!/bin/bash -x |
| 2 | |
| 3 | #cp -rfp inventory/sample inventory/oransc-cluster |
| 4 | . sample_env |
| 5 | declare -a IPS=($ANSIBLE_HOST_IP) |
| 6 | CONFIG_FILE=hosts.yaml python3 inventory.py ${IPS[@]} |
| 7 | export ANSIBLE_HOST_KEY_CHECKING=False |
| 8 | ansible-playbook -i hosts.yaml --become --private-key ${ANSIBLE_SSH_KEY} cluster.yml |
| 9 | |
| 10 | #sshpass -p $ANSIBLE_PASSWORD scp -o StrictHostKeyChecking=no -i ${ANSIBLE_SSH_KEY} -q root@$ANSIBLE_HOST_IP:/root/.kube/config ${PROJECT_ROOT}/config |
| 11 | scp -o StrictHostKeyChecking=no -i ${ANSIBLE_SSH_KEY} -q root@$ANSIBLE_HOST_IP:/root/.kube/config ${PROJECT_ROOT}/config |
| 12 | sed -i "s/127.0.0.1/${ANSIBLE_HOST_IP}/g" "${PROJECT_ROOT}"/config |