So what I think I'm trying to do is pretty simple, I need to execute the following in-order:

  1. Run a script that will install via script VBoxLinuxAdditions.run [this is working when I run it by itself]
  2. Run my synced_folder provision after the VBoxLinuxAdditions.run have been run [this works too by itself]

However I cannot get them to run in order together

Snippet of my code is below:

 config.vm.provision "foo", type: "shell", inline: <<-SHELL
    mkdir /mnt/iso
    mount -t iso9660 -o ro  /tmp/VBoxGuestAdditions.iso /mnt/iso/

  config.vm.synced_folder "~/tmp", "/home/vagrant/tmp"

The only problem is that synced_folder runs before the shell provisoner -- I guess that is because of the outer/inner precedence however I have been unable to figure out how to specify that the synched_folder run after "foo". I tried something like this, but no luck:

  config.vm.synced_folder "~/tmp", "/home/vagrant/tmp", after: "foo"

I've consulted the docs:

  1. sync_folder: https://www.vagrantup.com/docs/synced-folders/basic_usage
  2. provisioners: https://www.vagrantup.com/docs/provisioning/basic_usage

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.