Skip to content
This repository has been archived by the owner on Apr 29, 2019. It is now read-only.

Commit

Permalink
Merge pull request #99 from windwizard/fix-remove-vagrantfile-issue
Browse files Browse the repository at this point in the history
By default, do not remove vagrantfile-user-data. Fixes #98
  • Loading branch information
pires committed May 21, 2015
2 parents 93cebf8 + 50f205b commit d618ca8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ if enable_proxy
NO_PROXY = ENV['NO_PROXY'] || ENV['no_proxy'] || "localhost"
end

REMOVE_VAGRANTFILE_USER_DATA_BEFORE_HALT = (ENV['REMOVE_VAGRANTFILE_USER_DATA_BEFORE_HALT'].to_s.downcase == 'true')
# if this is set true, remember to use --provision when executing vagrant up / reload

CLOUD_PROVIDER = ENV['CLOUD_PROVIDER'].to_s.downcase || 'vagrant'
validCloudProviders = [ 'gce', 'gke', 'aws', 'azure', 'vagrant', 'vsphere',
'libvirt-coreos', 'juju' ]
Expand Down Expand Up @@ -298,7 +301,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
end

kHost.trigger.before [:halt, :reload] do
run_remote "sudo rm -f /var/lib/coreos-vagrant/vagrantfile-user-data"
if REMOVE_VAGRANTFILE_USER_DATA_BEFORE_HALT
run_remote "sudo rm -f /var/lib/coreos-vagrant/vagrantfile-user-data"
end
end

kHost.trigger.before [:destroy] do
Expand Down

0 comments on commit d618ca8

Please sign in to comment.