k8s: Extract hardcoded synced folder for dotfiles 06/92106/1
authorPawel Wieczorek <p.wieczorek2@samsung.com>
Fri, 26 Jul 2019 12:38:54 +0000 (14:38 +0200)
committerPawel Wieczorek <p.wieczorek2@samsung.com>
Fri, 26 Jul 2019 12:42:17 +0000 (14:42 +0200)
Issue-ID: SECCOM-235
Change-Id: I85efb88476cb1d6bfaee44b6bcd6275477e77ba5
Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
test/security/k8s/vagrant/dublin/Vagrantfile

index 224cd9a..f0dfbb5 100644 (file)
@@ -5,6 +5,7 @@ host_ip = "192.168.121.1"
 operator_key = "${HOME}/.ssh/onap-key"
 vagrant_user = "vagrant"
 vagrant_password = "vagrant"
+synced_folder = "/vagrant"
 
 vm_memory = 2 * 1024
 vm_cpus = 1
@@ -55,7 +56,8 @@ $deploy_key = <<-SCRIPT
 SCRIPT
 
 $link_dotfiles = <<-SCRIPT
-  for rc in /vagrant/dot_*; do
+  SYNC_DIR="$1"
+  for rc in ${SYNC_DIR}/dot_*; do
     src="$rc"
     dst="${HOME}/.${rc##*dot_}"
     echo "Symlinking ${src} to ${dst}"
@@ -94,10 +96,17 @@ Vagrant.configure('2') do |config|
       end
 
       if machine[:name] == 'operator'
-        config.vm.synced_folder "../../tools/config", "/vagrant", type: "rsync"
+        config.vm.synced_folder "../../tools/config", synced_folder, type: "rsync"
 
-        config.vm.provision "link_dotfiles_root", type: :shell, run: "always", inline: $link_dotfiles
-        config.vm.provision "link_dotfiles_user", type: :shell, run: "always", privileged: false, inline: $link_dotfiles
+        config.vm.provision "link_dotfiles_root", type: :shell, run: "always" do |s|
+          s.inline = $link_dotfiles
+          s.args = synced_folder
+        end
+        config.vm.provision "link_dotfiles_user", type: :shell, run: "always" do |s|
+          s.privileged = false
+          s.inline = $link_dotfiles
+          s.args = synced_folder
+        end
 
         config.vm.provision "get_rke", type: :shell, path: "../../tools/dublin/get_rke.sh"