From eb166a53ceb3e6f0f2b6a41c432fe3baa7d24d53 Mon Sep 17 00:00:00 2001 From: Pawel Wieczorek Date: Fri, 26 Jul 2019 14:38:54 +0200 Subject: k8s: Extract hardcoded synced folder for dotfiles Issue-ID: SECCOM-235 Change-Id: I85efb88476cb1d6bfaee44b6bcd6275477e77ba5 Signed-off-by: Pawel Wieczorek --- test/security/k8s/vagrant/dublin/Vagrantfile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'test/security/k8s') diff --git a/test/security/k8s/vagrant/dublin/Vagrantfile b/test/security/k8s/vagrant/dublin/Vagrantfile index 224cd9a11..f0dfbb519 100644 --- a/test/security/k8s/vagrant/dublin/Vagrantfile +++ b/test/security/k8s/vagrant/dublin/Vagrantfile @@ -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" -- cgit 1.2.3-korg