summaryrefslogtreecommitdiffstats
path: root/vagrant
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2019-01-06 07:22:08 -0800
committerVictor Morales <victor.morales@intel.com>2019-01-06 07:22:08 -0800
commite2bf06f1e964b05334ac179831c18e6cb95b396d (patch)
tree10cdba1c23104f9f5b9b3a20269006dbcbac1f2c /vagrant
parent6bbfadbdfe670334ad7755f3578d668d66dd9756 (diff)
Refactor docker-compose variables
The default environment variables required by docker-compose.yml file was exported to .env file to have better control on them. Change-Id: I52408cbf6e6918621a10158866d899d5f66a47eb Signed-off-by: Victor Morales <victor.morales@intel.com> Issue-ID: MULTICLOUD-301
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