Add setup of a pip virtualenv for kubespray use

Don't use incorrectly setup local provisioner that ships with kubespray,
and fix integration breakage with 1.10

Change-Id: Idf6019ef03afca9e47e75748cefd9a067b19d48c
diff --git a/kubespray-installer/setup.sh b/kubespray-installer/setup.sh
index be55105..0d1b25f 100755
--- a/kubespray-installer/setup.sh
+++ b/kubespray-installer/setup.sh
@@ -18,7 +18,7 @@
 # Installs Kubespray on remote target machines.
 #
 
-set -e -u -o pipefail
+set -e -o pipefail
 
 KS_COMMIT="${KS_COMMIT:-73a2a180061113ac124683e5cc492ba07df33d4c}"
 
@@ -34,6 +34,17 @@
   git checkout "$KS_COMMIT"
   popd
 
+  # create a virtualenv with specific packages, if it doesn't exist
+  if [ ! -x "ks_venv/bin/activate" ]
+  then
+    virtualenv ks_venv
+    pip install ansible==2.5.3
+    pip install -f kubespray/kubespray/requirements.txt
+  fi
+
+  # shellcheck disable=SC1091
+  source ks_venv/bin/activate
+
   # Generate inventory and var files
   echo "Generating The Inventory File"
 
@@ -53,7 +64,6 @@
   # Install Kubespray
   echo "Installing Kubespray"
   ansible-playbook -i "inventories/${DEPLOYMENT_NAME}/inventory.cfg" kubespray/cluster.yml -b -v
-
 }
 
 #