}
# takes a juju/accounts.yaml file and returns the password specific
-# for a controller. I wrote this using only bash tools to minimize
+# for a controller. I wrote this using only bash tools to minimize
# additions of other packages
function parse_juju_password {
password_file="${HOME}/.local/share/juju/accounts.yaml"
if [ -n "$INSTALL_PERFMON" ]; then
echo -e "\nUninstalling OSM Performance Monitoring stack"
remove_stack osm_metrics
- sg docker -c "docker image rm osm/kafka-exporter"
$WORKDIR_SUDO rm -rf $OSM_DOCKER_WORK_DIR/osm_metrics
fi
else
remove_stack osm_metrics
echo "Now osm docker images and volumes will be deleted"
newgrp docker << EONG
- docker image rm ${DOCKER_USER}/ro
- docker image rm ${DOCKER_USER}/lcm
- docker image rm ${DOCKER_USER}/light-ui
- docker image rm ${DOCKER_USER}/keystone
- docker image rm ${DOCKER_USER}/nbi
- docker image rm ${DOCKER_USER}/mon
- docker image rm ${DOCKER_USER}/pm
- docker image rm ${DOCKER_USER}/kafka-exporter
+ docker image rm ${DOCKER_USER}/ro:${OSM_DOCKER_TAG}
+ docker image rm ${DOCKER_USER}/lcm:${OSM_DOCKER_TAG}
+ docker image rm ${DOCKER_USER}/light-ui:${OSM_DOCKER_TAG}
+ docker image rm ${DOCKER_USER}/keystone:${OSM_DOCKER_TAG}
+ docker image rm ${DOCKER_USER}/nbi:${OSM_DOCKER_TAG}
+ docker image rm ${DOCKER_USER}/mon:${OSM_DOCKER_TAG}
+ docker image rm ${DOCKER_USER}/pol:${OSM_DOCKER_TAG}
+ docker image rm ${DOCKER_USER}/osmclient:${OSM_DOCKER_TAG}
EONG
remove_volumes $OSM_STACK_NAME
remove_network $OSM_STACK_NAME
#echo 'export OSM_SOL005=True' >> ${HOME}/.bashrc
[ -z "$INSTALL_LIGHTWEIGHT" ] && export OSM_HOSTNAME=`lxc list | awk '($2=="SO-ub"){print $6}'`
[ -z "$INSTALL_LIGHTWEIGHT" ] && export OSM_RO_HOSTNAME=`lxc list | awk '($2=="RO"){print $6}'`
- [ -n "$INSTALL_LIGHTWEIGHT" ] && export OSM_HOSTNAME=127.0.0.1
echo -e "\nOSM client installed"
- echo -e "You might be interested in adding the following OSM client env variables to your .bashrc file:"
- echo " export OSM_HOSTNAME=${OSM_HOSTNAME}"
- [ -n "$INSTALL_LIGHTWEIGHT" ] && echo " export OSM_SOL005=True"
- [ -z "$INSTALL_LIGHTWEIGHT" ] && echo " export OSM_RO_HOSTNAME=${OSM_RO_HOSTNAME}"
+ if [ -z "$INSTALL_LIGHTWEIGHT" ]; then
+ echo -e "You might be interested in adding the following OSM client env variables to your .bashrc file:"
+ echo " export OSM_HOSTNAME=${OSM_HOSTNAME}"
+ echo " export OSM_RO_HOSTNAME=${OSM_RO_HOSTNAME}"
+ else
+ echo -e "OSM client assumes that OSM host is running in localhost (127.0.0.1)."
+ echo -e "In case you want to interact with a different OSM host, you will have to configure this env variable in your .bashrc file:"
+ echo " export OSM_HOSTNAME=<OSM_host>"
+ fi
return 0
}
}
function juju_createcontroller() {
- if ! sg lxd -c "juju show-controller $OSM_STACK_NAME &> /dev/null"; then
+ if ! juju show-controller $OSM_STACK_NAME &> /dev/null; then
# Not found created, create the controller
sg lxd -c "juju bootstrap --bootstrap-series=xenial localhost $OSM_STACK_NAME"
fi
- [ $(sg lxd -c "juju controllers" | awk "/^${OSM_STACK_NAME}[\*| ]/{print $1}"|wc -l) -eq 1 ] || FATAL "Juju installation failed"
+ [ $(juju controllers | awk "/^${OSM_STACK_NAME}[\*| ]/{print $1}"|wc -l) -eq 1 ] || FATAL "Juju installation failed"
}
function generate_docker_images() {
sg docker -c "docker pull docker.elastic.co/beats/metricbeat:${ELASTIC_VERSION}" || FATAL "cannot get metricbeat docker image"
sg docker -c "docker pull docker.elastic.co/beats/filebeat:${ELASTIC_VERSION}" || FATAL "cannot get filebeat docker image"
sg docker -c "docker pull docker.elastic.co/kibana/kibana-oss:${ELASTIC_VERSION}" || FATAL "cannot get kibana docker image"
+ sg docker -c "docker pull bobrik/curator:${ELASTIC_CURATOR_VERSION}" || FATAL "cannot get curator docker image"
echo "Finished pulling elk docker images"
$WORKDIR_SUDO mkdir -p "$OSM_DOCKER_WORK_DIR/osm_elk"
$WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/osm_elk/* $OSM_DOCKER_WORK_DIR/osm_elk
KEYSTONEDB_TAG=10
OSM_DATABASE_COMMONKEY=
ELASTIC_VERSION=6.4.2
+ELASTIC_CURATOR_VERSION=5.5.4
while getopts ":hy-:b:r:k:u:R:l:p:D:o:m:H:S:s:w:t:U:" o; do
case "${o}" in
wget -q -O- https://osm-download.etsi.org/ftp/osm-4.0-four/README2.txt &> /dev/null
track end
echo -e "\nDONE"
-