Fix 1264: Vagrant images for v8.x
[osm/devops.git] / packer / packer_templates / osm / scripts / install_osm.sh
1 #!/bin/bash
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 #
15
16 wget https://osm-download.etsi.org/ftp/osm-7.0-seven/install_osm.sh
17 chmod +x install_osm.sh
18 #./install_osm.sh -c k8s --k8s_monitor --elk_stack 2>&1 | tee osm_install_log.txt
19 #./install_osm.sh -c k8s --k8s_monitor 2>&1 | tee osm_install_log.txt
20 ./install_osm.sh 2>&1 | tee osm_install_log.txt
21
22 # Saves the IP address used during install, in case the VM needed to be reinstantiated later with a different IP address
23 sudo mkdir -p ${STATE_FOLDER}
24 sudo chmod a+r ${STATE_FOLDER}
25 DEFAULT_IF=$(route -n |awk '$1~/^0.0.0.0/ {print $8}')
26 DEFAULT_IP=$(ip -o -4 a |grep ${DEFAULT_IF}|awk '{split($4,a,"/"); print a[1]}')
27 sudo su - -c "echo ${DEFAULT_IP} > ${STATE_FOLDER}/oldIPaddress.txt"