blob: 198f69e08f5e12baa84c751c8961a744c4d68412 [file] [log] [blame]
pceicicda1d10ac2022-11-10 23:59:17 +00001#!/bin/bash -x
2
3#cp -rfp inventory/sample inventory/oransc-cluster
4. sample_env
5declare -a IPS=($ANSIBLE_HOST_IP)
6CONFIG_FILE=hosts.yaml python3 inventory.py ${IPS[@]}
7export ANSIBLE_HOST_KEY_CHECKING=False
8ansible-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
11scp -o StrictHostKeyChecking=no -i ${ANSIBLE_SSH_KEY} -q root@$ANSIBLE_HOST_IP:/root/.kube/config ${PROJECT_ROOT}/config
12sed -i "s/127.0.0.1/${ANSIBLE_HOST_IP}/g" "${PROJECT_ROOT}"/config