The way I understood it is that `vagrant up` stops immediately if the machine is already up, so no provisioning in that case. `vagrant provision` works the other way round and will provision only if the machine is up.
With the "always provision" option set, this one-liner will do the trick: vagrant up || vagrant provision This is because `vagrant up` returns a non-zero status code if the machine is already up. Also, `vagrant reload` issues a `vagrant halt` followed by a `vagrant up` so should do the trick too. Le jeudi 26 février 2015 21:00:53 UTC+1, Chris Withers a écrit : > > Hi All, > > I'm using Vagrant 1.7.2. > > As per the docs, I have a config that looks like this: > > Vagrant.configure(2) do |config| > config.vm.box = "puphpet/debian75-x64" > config.vm.provision "shell", path: "provisioning/setup.sh" > config.vm.provision "shell", path: "provisioning/packages.sh", run: "always" > end > > I want setup.sh to run only when the VM is created, while I want > packages.sh to run every time there's a "vagrant up", regardless of whether > the VM is running or not and regardless of whether it has been provisioned > or not. > > https://docs.vagrantup.com/v2/provisioning/basic_usage.html suggests that > run: "always" is the way to do this, so what am I doing wrong? > > cheers, > > Chris > -- You received this message because you are subscribed to the Google Groups "Vagrant" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
