X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Finstall_osm.sh;h=9d10308c2cf5258f09174549f39ee0d888d50274;hb=refs%2Fchanges%2F24%2F5524%2F1;hp=f39eb4106d1a4e84af1bf76340e6458e967e189e;hpb=8f83069696a74f3fc9272a5c65d5e75e923e7ff9;p=osm%2Fdevops.git diff --git a/installers/install_osm.sh b/installers/install_osm.sh index f39eb410..9d10308c 100755 --- a/installers/install_osm.sh +++ b/installers/install_osm.sh @@ -188,6 +188,8 @@ function configure(){ echo -e " Configuring SO" sudo route add -host $JUJU_CONTROLLER_IP gw $VCA_CONTAINER_IP sudo sed -i "$ i route add -host $JUJU_CONTROLLER_IP gw $VCA_CONTAINER_IP" /etc/rc.local + echo RIFT_EXTERNAL_ADDRESS=$DEFAULT_IP | lxc exec SO-ub -- tee -a /usr/rift/etc/default/launchpad + lxc exec SO-ub -- systemctl restart launchpad so_is_up $SO_CONTAINER_IP @@ -209,14 +211,50 @@ function configure(){ --data '{"account": [ { "name": "osmjuju", "account-type": "juju", "juju": { "ip-address": "'$JUJU_CONTROLLER_IP'", "port": "17070", "user": "admin", "secret": "'$JUJU_PASSWD'" } } ]}') [[ $result =~ .*success.* ]] || FATAL "Failed config-agent configuration: $result" + #R1/R2 config line + #result=$(curl -k --request PUT \ + # --url https://$SO_CONTAINER_IP:8008/api/config/resource-orchestrator \ + # --header 'accept: application/vnd.yang.data+json' \ + # --header 'authorization: Basic YWRtaW46YWRtaW4=' \ + # --header 'cache-control: no-cache' \ + # --header 'content-type: application/vnd.yang.data+json' \ + # --data '{ "openmano": { "host": "'$RO_CONTAINER_IP'", "port": "9090", "tenant-id": "'$RO_TENANT_ID'" }, "name": "osmopenmano", "account-type": "openmano" }') + result=$(curl -k --request PUT \ - --url https://$SO_CONTAINER_IP:8008/api/config/resource-orchestrator \ + --url https://$SO_CONTAINER_IP:8008/api/config/project/default/ro-account/account \ --header 'accept: application/vnd.yang.data+json' \ --header 'authorization: Basic YWRtaW46YWRtaW4=' \ - --header 'cache-control: no-cache' \ + --header 'cache-control: no-cache' \ --header 'content-type: application/vnd.yang.data+json' \ - --data '{ "openmano": { "host": "'$RO_CONTAINER_IP'", "port": "9090", "tenant-id": "'$RO_TENANT_ID'" }, "name": "osmopenmano", "account-type": "openmano" }') + --data '{"rw-ro-account:account": [ { "openmano": { "host": "'$RO_CONTAINER_IP'", "port": "9090", "tenant-id": "'$RO_TENANT_ID'"}, "name": "osmopenmano", "ro-account-type": "openmano" }]}') [[ $result =~ .*success.* ]] || FATAL "Failed resource-orchestrator configuration: $result" + + result=$(curl -k --request PATCH \ + --url https://$SO_CONTAINER_IP:8008/v2/api/config/openidc-provider-config/rw-ui-client/redirect-uri \ + --header 'accept: application/vnd.yang.data+json' \ + --header 'authorization: Basic YWRtaW46YWRtaW4=' \ + --header 'cache-control: no-cache' \ + --header 'content-type: application/vnd.yang.data+json' \ + --data '{"redirect-uri": "https://'$DEFAULT_IP':8443/callback" }') + [[ $result =~ .*success.* ]] || FATAL "Failed redirect-uri configuration: $result" + + result=$(curl -k --request PATCH \ + --url https://$SO_CONTAINER_IP:8008/v2/api/config/openidc-provider-config/rw-ui-client/post-logout-redirect-uri \ + --header 'accept: application/vnd.yang.data+json' \ + --header 'authorization: Basic YWRtaW46YWRtaW4=' \ + --header 'cache-control: no-cache' \ + --header 'content-type: application/vnd.yang.data+json' \ + --data '{"post-logout-redirect-uri": "https://'$DEFAULT_IP':8443/?api_server=https://'$DEFAULT_IP'" }') + [[ $result =~ .*success.* ]] || FATAL "Failed post-logout-redirect-uri configuration: $result" + + lxc exec SO-ub -- tee /etc/network/interfaces.d/60-rift.cfg </dev/null || FATAL "lxd not present, exiting." wget -q -O- https://osm-download.etsi.org/ftp/osm-2.0-two/README.txt &> /dev/null +# use local devops for containers +export OSM_USE_LOCAL_DEVOPS=true if [ -z "$INSTALL_FROM_SOURCE" ]; then echo -e "\nCreating the containers and installing from binaries ..." $OSM_DEVOPS/jenkins/host/install RO $REPOSITORY $RELEASE $REPOSITORY_KEY $REPOSITORY_BASE || FATAL "RO install failed"