summaryrefslogtreecommitdiffstats
path: root/vagrant
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2019-01-10 16:12:47 +0000
committerGerrit Code Review <gerrit@onap.org>2019-01-10 16:12:47 +0000
commit8db0a40746925ffdd98c6b6718a05e31d17fc755 (patch)
tree38c14c9c74d9238af8c7068967f8ff1baf930421 /vagrant
parent78316e2f313b414e224113150f80140dc0dc12e1 (diff)
parente2bf06f1e964b05334ac179831c18e6cb95b396d (diff)
Merge "Refactor docker-compose variables"
Diffstat (limited to 'vagrant')
-rwxr-xr-xvagrant/installer.sh17
1 files changed, 13 insertions, 4 deletions
diff --git a/vagrant/installer.sh b/vagrant/installer.sh
index 271f44f5..cf1eb357 100755
--- a/vagrant/installer.sh
+++ b/vagrant/installer.sh
@@ -85,6 +85,16 @@ function _install_docker {
sleep 10
}
+function _set_environment_file {
+ ansible_ifconfig=$(ansible ovn-central[0] -i $krd_inventory -m shell -a "ifconfig eth1 |grep \"inet addr\" |awk '{print \$2}' |awk -F: '{print \$2}'")
+ if [[ $ansible_ifconfig != *CHANGED* ]]; then
+ echo "Fail to get the OVN central IP address from eth1 nic"
+ exit
+ fi
+ echo "export OVN_CENTRAL_ADDRESS=$(echo ${ansible_ifconfig#*>>} | tr '\n' ':')6641" | sudo tee --append /etc/environment
+ echo "export KUBE_CONFIG_DIR=/opt/kubeconfig" | sudo tee --append /etc/environment
+}
+
# install_k8s() - Install Kubernetes using kubespray tool
function install_k8s {
echo "Deploying kubernetes"
@@ -151,8 +161,8 @@ function install_plugin {
sudo mkdir -p /opt/{kubeconfig,consul/config}
sudo cp $HOME/.kube/config /opt/kubeconfig/krd
- export KUBE_CONFIG_DIR=/opt/kubeconfig
- echo "export KUBE_CONFIG_DIR=${KUBE_CONFIG_DIR}" | sudo tee --append /etc/environment
+ _set_environment_file
+ source /etc/environment
pushd $krd_folder/../deployments
sudo ./build.sh
@@ -213,8 +223,7 @@ testing_enabled=${KRD_ENABLE_TESTS:-false}
sudo mkdir -p $log_folder
sudo mkdir -p /opt/csar
sudo chown -R $USER /opt/csar
-export CSAR_DIR=/opt/csar
-echo "export CSAR_DIR=${CSAR_DIR}" | sudo tee --append /etc/environment
+echo "export CSAR_DIR=/opt/csar" | sudo tee --append /etc/environment
# Install dependencies
# Setup proxy variables