Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Vagrant provisioning on the first run?

I have a very simple Vagrant file like this:

  config.vm.box = "precise32"
  config.vm.synced_folder "./src", "/vagrant/src/"
  config.vm.network "forwarded_port", guest: 8080, host: 8080
  config.vm.provision :shell, :path => "install.sh"

When I do vagrant up the install.sh is not called, but I have to reload with --provision. How do I run install.sh on the first up?

like image 880
RParadox Avatar asked Dec 07 '22 05:12

RParadox


1 Answers

From Vagrant 1.3 onwards, provisioning runs automatically only at the very first boot, when the machine gets created.

If you need to run it on the subsequent reload or up, you have to call it explicitly:

vagrant up --provision

See also: GH-1776 [commit].

like image 182
Emyl Avatar answered Dec 18 '22 01:12

Emyl