Skip to content

Instantly share code, notes, and snippets.

@damko
Created February 11, 2015 14:33
Show Gist options
  • Save damko/ddfe1dc9017031a1405e to your computer and use it in GitHub Desktop.
Save damko/ddfe1dc9017031a1405e to your computer and use it in GitHub Desktop.
Prevent accidental halt of vagrant production vms
In Vagrantfile add the IF block right after the config.vm.define for the production vm
config.vm.define DO_VM_NAME do |production|
if ARGV[0] == 'halt'
puts "You can not halt the production vm"
ARGV.clear
exit
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment