diff --git a/plugins/providers/docker/action.rb b/plugins/providers/docker/action.rb index c3f8dfe01..52d0a2f7a 100644 --- a/plugins/providers/docker/action.rb +++ b/plugins/providers/docker/action.rb @@ -217,9 +217,6 @@ module VagrantPlugins def self.action_start Vagrant::Action::Builder.new.tap do |b| b.use Call, IsState, :running do |env, b2| - # If the container is running and we're not doing a run, we're done - next if env[:result] && env[:machine_action] != :run_command - if env[:machine_action] != :run_command b2.use Call, HasSSH do |env2, b3| if env2[:result] @@ -232,6 +229,9 @@ module VagrantPlugins end end + # If the container is running and we're doing a run, we're done + next if env[:result] && env[:machine_action] != :run_command + b2.use Call, IsState, :not_created do |env2, b3| if env2[:result] # First time making this thing, set to the "preparing" state diff --git a/plugins/providers/hyperv/action.rb b/plugins/providers/hyperv/action.rb index 1e2a19694..ade9fd4f4 100644 --- a/plugins/providers/hyperv/action.rb +++ b/plugins/providers/hyperv/action.rb @@ -106,7 +106,7 @@ module VagrantPlugins Vagrant::Action::Builder.new.tap do |b| b.use Call, IsState, :running do |env1, b1| if env1[:result] - b1.use Message, I18n.t("vagrant_hyperv.message_already_running") + b1.use action_provision next end diff --git a/plugins/providers/virtualbox/action.rb b/plugins/providers/virtualbox/action.rb index f43846191..1f0130791 100644 --- a/plugins/providers/virtualbox/action.rb +++ b/plugins/providers/virtualbox/action.rb @@ -315,9 +315,9 @@ module VagrantPlugins b.use ConfigValidate b.use BoxCheckOutdated b.use Call, IsRunning do |env, b2| - # If the VM is running, then our work here is done, exit + # If the VM is running, run the necessary provisioners if env[:result] - b2.use MessageAlreadyRunning + b2.use action_provision next end