diff options
author | Victor Morales <victor.morales@intel.com> | 2017-11-08 07:28:28 -0800 |
---|---|---|
committer | Victor Morales <victor.morales@intel.com> | 2017-11-08 07:36:16 -0800 |
commit | 4ab71c18e0c7ab0ce299a8708488ab84a97aea82 (patch) | |
tree | 45e83c3d83e9d5dc46c27c5c2aa9e8c9a1e18a23 /bootstrap/vagrant-onap/lib/functions | |
parent | 6dbd7da003f938e2dbd73944624e8679027c35ca (diff) |
Add OpenStack support
This change allows the provisioning of an All-in-One OpenStack
deployment through ansible-kolla project. Given that it uses System D
this adds an exception to use Ubuntu Xenial release.
Change-Id: I57973a1b5cc331654fbabf7932ddcfef817afedf
Signed-off-by: Victor Morales <victor.morales@intel.com>
Issue-Id: INT-329
Diffstat (limited to 'bootstrap/vagrant-onap/lib/functions')
-rwxr-xr-x | bootstrap/vagrant-onap/lib/functions | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/bootstrap/vagrant-onap/lib/functions b/bootstrap/vagrant-onap/lib/functions index cc9052304..25fbba3e9 100755 --- a/bootstrap/vagrant-onap/lib/functions +++ b/bootstrap/vagrant-onap/lib/functions @@ -5,7 +5,8 @@ source /var/onap/_composed_functions source /var/onap/_onap_functions export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' |sort -n | head -1) -export IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2) +export NIC=$(ip route get 8.8.8.8 | awk '{ print $5; exit }') +export IP_ADDRESS=$(ifconfig $NIC | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2) mvn_conf_file=/root/.m2/settings.xml git_src_folder=/opt @@ -16,6 +17,14 @@ function configure_dns { resolvconf -u } +# get_next_ip() - Function that provides the next ip +function get_next_ip { + local ip=${1:-$IP_ADDRESS} + ip_hex=$(printf '%.2X%.2X%.2X%.2X\n' `echo $ip | sed -e 's/\./ /g'`) + next_ip_hex=$(printf %.8X `echo $(( 0x$ip_hex + 1 ))`) + echo $(printf '%d.%d.%d.%d\n' `echo $next_ip_hex | sed -r 's/(..)/0x\1 /g'`) +} + # _git_timed() - git can sometimes get itself infinitely stuck with transient network # errors or other issues with the remote end. This wraps git in a # timeout/retry loop and is intended to watch over non-local git @@ -142,7 +151,6 @@ function _configure_docker_settings { rm $docker_conf_backup echo "DOCKER_OPTS=\"-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock\"" >> $docker_conf - usermod -a -G docker vagrant } # install_nodejs() - Download and install NodeJS @@ -165,17 +173,17 @@ function install_python { # _install_pip() - Install Python Package Manager function _install_pip { install_python - if [ ! -f /usr/local/bin/pip ]; then + if ! which pip; then curl -sL https://bootstrap.pypa.io/get-pip.py | python fi } # install_python_package() - Install a python module function install_python_package { - local python_package=$1 + local python_packages=$@ _install_pip - pip install $python_package + pip install $python_packages } # install_docker() - Download and install docker-engine |