From 6e987f845549d9894d1c5bf72a6bb3b2b1e8e3a5 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Thu, 5 Sep 2019 14:12:39 -0400 Subject: [PATCH] add CNI plugins to Vagrant install --- Vagrantfile | 4 ++++ scripts/vagrant-linux-priv-cni.sh | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 scripts/vagrant-linux-priv-cni.sh diff --git a/Vagrantfile b/Vagrantfile index 7fab7e224..8c5bb6518 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -137,6 +137,10 @@ def configureLinuxProvisioners(vmCfg) privileged: true, path: './scripts/vagrant-linux-priv-consul.sh' + vmCfg.vm.provision "shell", + privileged: true, + path: './scripts/vagrant-linux-priv-cni.sh' + vmCfg.vm.provision "shell", privileged: true, path: './scripts/vagrant-linux-priv-vault.sh' diff --git a/scripts/vagrant-linux-priv-cni.sh b/scripts/vagrant-linux-priv-cni.sh new file mode 100755 index 000000000..8512da17a --- /dev/null +++ b/scripts/vagrant-linux-priv-cni.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -o errexit + +VERSION="v0.8.2" +DOWNLOAD=https://github.com/containernetworking/plugins/releases/download/${VERSION}/cni-plugins-linux-amd64-${VERSION}.tgz +TARGET_DIR=/opt/cni/bin + +function install_cni() { + mkdir -p ${TARGET_DIR} + if [[ -e ${TARGET_DIR}/${VERSION} ]] ; then + return + fi + + wget -q -O /tmp/cni-plugins.tar.gz ${DOWNLOAD} + tar -xf /tmp/cni-plugins.tar.gz -C ${TARGET_DIR} + touch ${TARGET_DIR}/${VERSION} +} + +install_cni