Increase inline provisioners configurability

Scripts "get_oom" and "deploy_onap" are more useful if an additional
parameter is accepted: external repository and deployment override,
respectively.

These parameteres will make testing easier and allow improving this
setup quicker. Previous behaviour stays as it was using default
argument values.

Changes in their invocations were meant to make ad-hoc modifications
more explicit.

SSH configuration from host machine is synchronized in case additional
access rights are necessary.

Issue-ID: ONAPARC-551
Change-Id: I585586f721457388ab30b089f2c25c4ad88ad4d3
Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
diff --git a/bootstrap/vagrant-minimal-onap/Vagrantfile b/bootstrap/vagrant-minimal-onap/Vagrantfile
index e12c035..5272dd6 100644
--- a/bootstrap/vagrant-minimal-onap/Vagrantfile
+++ b/bootstrap/vagrant-minimal-onap/Vagrantfile
@@ -115,7 +115,8 @@
 
 $get_oom = <<-SCRIPT
   BRANCH="${1:-5.0.1-ONAP}"
-  git clone -b "$BRANCH" https://git.onap.org/oom --recurse-submodules
+  REPO="${2:-https://git.onap.org/oom}"
+  git clone -b "$BRANCH" "$REPO" --recurse-submodules
 SCRIPT
 
 $get_helm_plugins = "mkdir -p ${HOME}/.helm && cp -R ${HOME}/oom/kubernetes/helm/plugins/ ${HOME}/.helm"
@@ -139,7 +140,9 @@
 SCRIPT
 
 $deploy_onap = <<-SCRIPT
-  ENV="$1"
+  OVERRIDE="${1:-${HOME}/oom/kubernetes/onap/resources/environments/minimal-onap.yaml}"
+
+  ENV="${2:-#{os_env}}"
   export $(cat "$ENV" | xargs)
 
   encrypt () {
@@ -153,7 +156,6 @@
 
   export KUBECONFIG="${HOME}/.kube/config.onap"
 
-  OVERRIDE="${HOME}/oom/kubernetes/onap/resources/environments/minimal-onap.yaml"
   helm deploy minimal local/onap --namespace onap -f "$OVERRIDE" --verbose --timeout 900
 SCRIPT
 
@@ -196,6 +198,7 @@
 
       if machine[:name] == 'operator'
         config.vm.synced_folder ".", synced_folder_main, type: "rsync", rsync__exclude: ["Vagrantfile", "operator"]
+        config.vm.synced_folder "~/.ssh", "/home/#{vagrant_user}/.ssh", type: "rsync", rsync__exclude: "authorized_keys"
         config.vm.synced_folder "./operator", "/home/#{vagrant_user}", type: "sshfs", reverse: true, sshfs_opts_append: "-o nonempty"
 
         config.vm.provision "setup_debconf", type: :shell, inline: $setup_debconf
@@ -245,7 +248,10 @@
           s.path = "tools/setup_kubectl.sh"
         end
         config.vm.provision "get_helm", type: :shell, path: "tools/get_helm.sh"
-        config.vm.provision "get_oom", type: :shell, privileged: false, inline: $get_oom
+        config.vm.provision "get_oom", type: :shell do |s|
+          s.privileged = false
+          s.inline = $get_oom
+        end
         config.vm.provision "get_helm_plugins", type: :shell, privileged: false, inline: $get_helm_plugins
         config.vm.provision "install_make", type: :shell, inline: $install_make
         config.vm.provision "setup_helm_cluster", type: :shell, run: "never", privileged: false, inline: $setup_helm_cluster
@@ -253,7 +259,6 @@
         config.vm.provision "deploy_onap", type: :shell, run: "never" do |s|
           s.privileged = false
           s.inline = $deploy_onap
-          s.args = os_env
         end
       end
     end