Revert juju agent version
[osm/devops.git] / installers / install_juju.sh
index 4ecf0a5..c9f0efe 100755 (executable)
@@ -80,21 +80,14 @@ clouds:
       ssl-hostname-verification: false
 EOF
     openssl req -nodes -new -x509 -keyout /tmp/.osm/client.key -out /tmp/.osm/client.crt -days 365 -subj "/C=FR/ST=Nice/L=Nice/O=ETSI/OU=OSM/CN=osm.etsi.org"
-    local server_cert=`cat /var/snap/lxd/common/lxd/server.crt | sed 's/^/        /'`
-    local client_cert=`cat /tmp/.osm/client.crt | sed 's/^/        /'`
-    local client_key=`cat /tmp/.osm/client.key | sed 's/^/        /'`
-
     cat << EOF > $LXD_CREDENTIALS
 credentials:
   $OSM_VCA_CLOUDNAME:
     lxd-cloud:
       auth-type: certificate
-      server-cert: |
-$server_cert
-      client-cert: |
-$client_cert
-      client-key: |
-$client_key
+      server-cert: /var/snap/lxd/common/lxd/server.crt
+      client-cert: /tmp/.osm/client.crt
+      client-key: /tmp/.osm/client.key
 EOF
     lxc config trust add local: /tmp/.osm/client.crt
     juju add-cloud -c $OSM_STACK_NAME $OSM_VCA_CLOUDNAME $LXD_CLOUD --force
@@ -104,18 +97,6 @@ EOF
     [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
 }
 
-function juju_createcontroller() {
-    [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
-    if ! juju show-controller $OSM_STACK_NAME &> /dev/null; then
-        # Controller not found, create the controller
-        sudo usermod -a -G lxd ${USER}
-        sg lxd -c "juju bootstrap -v --debug --bootstrap-series=xenial --agent-version=$JUJU_AGENT_VERSION $OSM_VCA_CLOUDNAME $OSM_STACK_NAME"
-    fi
-    [ $(juju controllers | awk "/^${OSM_STACK_NAME}[\*| ]/{print $1}"|wc -l) -eq 1 ] || FATAL "Juju installation failed"
-    juju controller-config features=[k8s-operators]
-    [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
-}
-
 #Safe unattended install of iptables-persistent
 function check_install_iptables_persistent(){
     [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
@@ -143,7 +124,7 @@ function juju_createproxy() {
 DEBUG_INSTALL=""
 INSTALL_CACHELXDIMAGES=""
 INSTALL_NOJUJU=""
-JUJU_AGENT_VERSION=2.9.17
+JUJU_AGENT_VERSION=2.9.34
 JUJU_VERSION=2.9
 OSM_DEVOPS=
 OSM_STACK_NAME=osm
@@ -221,7 +202,6 @@ if [ -z "$OSM_VCA_HOST" ]; then
             juju add-cloud $OSM_VCA_CLOUDNAME $LXD_CLOUD_FILE --force || juju update-cloud $OSM_VCA_CLOUDNAME --client -f $LXD_CLOUD_FILE
             juju add-credential $OSM_VCA_CLOUDNAME -f $LXD_CRED_FILE || juju update-credential $OSM_VCA_CLOUDNAME lxd-cloud-creds -f $LXD_CRED_FILE
         fi
-        juju_createcontroller
         juju_createproxy
     else
         OSM_VCA_CLOUDNAME="lxd-cloud"