Remove OSMLCM_VCA_CACERT 31/7931/3
authorAdam Israel <adam.israel@canonical.com>
Mon, 9 Sep 2019 08:33:13 +0000 (11:33 +0300)
committerAdam Israel <adam.israel@canonical.com>
Mon, 9 Sep 2019 08:52:31 +0000 (11:52 +0300)
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 <adam.israel@canonical.com>
installers/docker/__lcm__.env
installers/full_install_osm.sh

index 7341297..466b750 100644 (file)
@@ -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__
index 167ca87..1d732a3 100755 (executable)
@@ -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"