From 53755c17ef58d424e138bac3a038a6f6125395fe Mon Sep 17 00:00:00 2001 From: Lorenzo Arribas Date: Wed, 30 Mar 2016 10:58:33 +0200 Subject: [PATCH 1/2] Execute provisioner cleanup before terminating the instance, so that they can access the machine via ssh --- lib/vagrant-aws/action.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/vagrant-aws/action.rb b/lib/vagrant-aws/action.rb index c140ac44..bb055587 100644 --- a/lib/vagrant-aws/action.rb +++ b/lib/vagrant-aws/action.rb @@ -46,14 +46,15 @@ def self.action_destroy if env[:result] b2.use ConfigValidate b2.use Call, IsCreated do |env2, b3| - if !env2[:result] + unless env2[:result] b3.use MessageNotCreated next end + b3.use ConnectAWS b3.use ElbDeregisterInstance + b3.use ProvisionerCleanup, :before if defined?(ProvisionerCleanup) b3.use TerminateInstance - b3.use ProvisionerCleanup if defined?(ProvisionerCleanup) end else b2.use MessageWillNotDestroy From a8bc8859366697008dc94ee6bedd3765c33fa84d Mon Sep 17 00:00:00 2001 From: Lorenzo Arribas Date: Wed, 30 Mar 2016 15:39:51 +0200 Subject: [PATCH 2/2] Use the same conditional format used for other actions --- lib/vagrant-aws/action.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant-aws/action.rb b/lib/vagrant-aws/action.rb index bb055587..2b5c7cd0 100644 --- a/lib/vagrant-aws/action.rb +++ b/lib/vagrant-aws/action.rb @@ -46,7 +46,7 @@ def self.action_destroy if env[:result] b2.use ConfigValidate b2.use Call, IsCreated do |env2, b3| - unless env2[:result] + if !env2[:result] b3.use MessageNotCreated next end