You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/content/docs/triggers/usage.mdx
+44-1Lines changed: 44 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,7 +96,7 @@ running either `vagrant destroy` or `vagrant halt` would stop tinyproxy.
96
96
97
97
Triggers can also be defined to run Ruby, rather than bash or PowerShell. An
98
98
example of this might be using a Ruby option to get more information from the `VBoxManage`
99
-
tool. In this case, we are printing the `ostype` defined for thte guest after
99
+
tool. In this case, we are printing the `ostype` defined for the guest after
100
100
it has been brought up.
101
101
102
102
```ruby
@@ -196,3 +196,46 @@ config.trigger.before :"Vagrant::Action::Builtin::GracefulHalt", type: :action d
196
196
t.warn="Vagrant is halting your guest..."
197
197
end
198
198
```
199
+
200
+
#### Provision action
201
+
202
+
The provision stack works little different than the other action stacks. The Vagrant
203
+
stack is made up of middlewares that are run in a specific order. generally it tend to
204
+
to perform their operation and call to the next item but in some cases will continue to
205
+
do things once the next item completes. In the Provision action, the next item in the
206
+
stack is executed [here](https://github.com/hashicorp/vagrant/blob/main/lib/vagrant/action/builtin/provision.rb#L82-L83).but the actual provisioning happens at the end [here](https://github.com/hashicorp/vagrant/blob/main/lib/vagrant/action/builtin/provision.rb#L129-L133), after the rest of the stack
207
+
has executed and exited.
208
+
209
+
210
+
```
211
+
Vagrant.configure("2") do |config|
212
+
config.vm.box = "ubuntu"
213
+
214
+
# Provisioners:
215
+
config.vm.provision "PROVISIONER1", type: :shell, inline: "echo executing first provisioner"
216
+
config.vm.provision "PROVISIONER2", type: :shell, inline: "echo executing second provisioner"
0 commit comments