X-Git-Url: https://gerrit.onap.org/r/gitweb?p=demo.git;a=blobdiff_plain;f=tutorials%2FvFWDT%2Fplaybooks%2Fconfigure_ansible.sh;h=c49153f8b2c205769c2c8dfba3d149fae8c46d1a;hp=5c1979631ebf14883688d4eafed0c2f43797742d;hb=42ecc70c1f5a05c4de5dda414a7964398552b47d;hpb=7e52797291d42161a2e43e18040616fe1f7b31bd diff --git a/tutorials/vFWDT/playbooks/configure_ansible.sh b/tutorials/vFWDT/playbooks/configure_ansible.sh index 5c197963..c49153f8 100755 --- a/tutorials/vFWDT/playbooks/configure_ansible.sh +++ b/tutorials/vFWDT/playbooks/configure_ansible.sh @@ -17,6 +17,32 @@ # # ============LICENSE_END========================================================= +if [ ! -f playbooks/onap.pem ]; then + echo "onap.pem file does not exist" + exit +fi + +K8S_NODE_IP=`kubectl get nodes -o=wide | grep 01 | awk {'print $6'}` + +CDT_REQ_DIR="workflow/templates/cdt-requests" + +echo "APPC Artifacts configuration" + +for f in $CDT_REQ_DIR/*.json; do + echo "" + echo "Uploading $f" + RES=`curl -k -s -X POST -H "Content-Type: application/json" -d @$f https://$K8S_NODE_IP:30211/cdtService/getDesigns` + echo "$RES" + + if [[ $RES != *'"code":"400","message":"success"'* ]]; then + echo "CDT Artifact Upload failed" + exit + fi +done + +echo "APPC Artifacts configuration completed" + +echo "APPC Ansible configuration" ANSIBLE=`kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}' | grep appc-ansible` echo $ANSIBLE