Is there a way to disable some roaming commands for a particular VM?
I am working with an Amazon EC2 instance using the vagrant-aws plugin for Vagrant. I bind an instance with vagrant up --provider=aws
and ... like commands vagrant halt
, vagrant reload
and especially vagrant destroy
it becomes very dangerous in my situation because they can destroy the instance! So the question is, how do I disable some vagrant commands (eg in Vagrantfile) ? I need to provide the configured Vagrantfile to other developers, so there is a chance they might shut down an important server. Thank!
source to share
Disclaimer: I am a plugin maker.
Using the vagrant-triggers plugin , you can write in yours Vagrantfile
something like:
config.trigger.reject [:destroy, :halt]
source to share
Take a look at the Vagrant ManagedServers plugin . It is designed for managing and sharing cloud instances between developers, even in production.
Note that usually (without the aforementioned plugin) sharing the Vagrantfile alone is not enough to access the same EC2 instance. The instance details are stored in the .vagrant directory and each developer spins up their own server.
source to share