From 5a50a063bb187a1da368254c79ad1a4b8c0f0042 Mon Sep 17 00:00:00 2001 From: Adam Israel Date: Mon, 9 Sep 2019 11:33:13 +0300 Subject: [PATCH] Remove OSMLCM_VCA_CACERT Removes the OSMLCM_VCA_CACERT variable from __lcm__.env in order to fix the VCA. This works around the parsing of the OSMLCM_VCA_CACERT in full_install.sh, which currently truncates the cert, causing it to be invalid. Change-Id: I8e8c8199bc27ac919e4bf7e6442e6746bb503c8a Signed-off-by: Adam Israel --- installers/docker/__lcm__.env | 14 +++++++++++++- installers/full_install_osm.sh | 18 +++++++++--------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/installers/docker/__lcm__.env b/installers/docker/__lcm__.env index 7341297b..466b750a 100644 --- a/installers/docker/__lcm__.env +++ b/installers/docker/__lcm__.env @@ -1,4 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + OSMLCM_VCA_HOST=__JUJU_CONTROLLER_IP__ OSMLCM_VCA_SECRET=__JUJU_PASSWORD__ OSMLCM_VCA_PUBKEY=__JUJU_PUBKEY__ -OSMLCM_VCA_CACERT=__JUJU_CACERT__ diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 167ca87b..1d732a3a 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -779,11 +779,11 @@ function generate_docker_env_files() { $WORKDIR_SUDO sed -i "s|OSMLCM_VCA_PUBKEY.*|OSMLCM_VCA_PUBKEY=\"${OSM_VCA_PUBKEY}\"|g" $OSM_DOCKER_WORK_DIR/lcm.env fi - if ! grep -Fq "OSMLCM_VCA_CACERT" $OSM_DOCKER_WORK_DIR/lcm.env; then - echo "OSMLCM_VCA_CACERT=\"${OSM_VCA_CACERT}\"" | $WORKDIR_SUDO tee -a $OSM_DOCKER_WORK_DIR/lcm.env - else - $WORKDIR_SUDO sed -i "s|OSMLCM_VCA_CACERT.*|OSMLCM_VCA_CACERT=\"${OSM_VCA_CACERT}\"|g" $OSM_DOCKER_WORK_DIR/lcm.env - fi + #if ! grep -Fq "OSMLCM_VCA_CACERT" $OSM_DOCKER_WORK_DIR/lcm.env; then + # echo "OSMLCM_VCA_CACERT=\"${OSM_VCA_CACERT}\"" | $WORKDIR_SUDO tee -a $OSM_DOCKER_WORK_DIR/lcm.env + #else + # $WORKDIR_SUDO sed -i "s|OSMLCM_VCA_CACERT.*|OSMLCM_VCA_CACERT=\"${OSM_VCA_CACERT}\"|g" $OSM_DOCKER_WORK_DIR/lcm.env + #fi # RO MYSQL_ROOT_PASSWORD=$(generate_secret) @@ -1031,10 +1031,10 @@ function install_lightweight() { OSM_VCA_PUBKEY=$(cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub) [ -z "$OSM_VCA_PUBKEY" ] && FATAL "Cannot obtain juju public key" fi - if [ -z "$OSM_VCA_CACERT" ]; then - OSM_VCA_CACERT=$(juju controllers --format json | jq -r '.controllers["osm"]["ca-cert"]' | grep -v "\-\-\-\-\-.*CERTIFICATE\-\-\-\-\-") - [ -z "$OSM_VCA_CACERT" ] && FATAL "Cannot obtain juju CA certificate" - fi + #if [ -z "$OSM_VCA_CACERT" ]; then + #OSM_VCA_CACERT=$(juju controllers --format json | jq -r '.controllers["osm"]["ca-cert"]' | grep -v "\-\-\-\-\-.*CERTIFICATE\-\-\-\-\-") + # [ -z "$OSM_VCA_CACERT" ] && FATAL "Cannot obtain juju CA certificate" + #fi if [ -z "$OSM_DATABASE_COMMONKEY" ]; then OSM_DATABASE_COMMONKEY=$(generate_secret) [ -z "OSM_DATABASE_COMMONKEY" ] && FATAL "Cannot generate common db secret" -- 2.25.1