In my Vagrantfile, I have a provisioner like so:
config.vm.provision "reset", type: "shell", run: "always" do |s|
s.privileged = false
s.inline = "bash /path/to/my/reset/script.sh"
end
And when normally provisioning vagrant, it runs fine. But what I would like to do, is setup a provisioner that only runs when I manually call it. So if I were to have the following provisioner:
config.vm.provision "otherScript", type: "shell", run: "manual" do |s|
s.privileged = false
s.inline = "bash /path/to/my/other/script.sh"
end
I would run it with vagrant provision --provision-with otherScript
. I can already do that with other provisioners. But I cannot find a way to make it so when I do things like vagrant provision
it skips any with a run setting of manual
. I can't find anything in the docs related to it other than that I can use "always".
I have considered using something like fabric or invoke (python 3) but then I would have to set that up on all the computers in my team. Which I can setup with a script, but I figured this may be easier if possible.
Is there a way to accomplish this? To setup a provisioner that only ever runs when I manually call it?