Vagrant::Blocker
Block certain VMs from running together in a multi-VM vagrant setup.
Installation
vagrant plugin install vagrant-blocker
Usage
This plugin can be used to make sure certain machines can not be run together: When bringing a machine up, an error will be thrown whenever a box that blocks or is blocked by an already running machine.
config.vm.define 'foo' do |vm|
vm.blocker.blocks = 'bar'
end
config.vm.define 'bar'
By default, if a non-existant machine is configured in the blockers, an error
will be thrown. You can disable this behaviour by setting strict_config to false:
config.blocker.strict_config = false
config.vm.define 'strict' do |vm|
vm.blocker.strict_config = true
vm.blocker.blocks = %w(foo nonexistant)
end
config.vm.define 'foo'
Testing
- Clone it
- Ensure you have the correct bundler version (by using RVM).
echo 'vagrant-blocker' > .ruby-gemset
echo '2.3.1' > .ruby-version
rvm --create use `cat .ruby-version`@`cat .ruby-gemset`
gem update --system
gem install bundler --version 1.12.5
- Run
bundle install - You can use vagrant like you are used to with
bundle exec vagrant <command>. An example Vagrantfile can be found in the test folder.
Contributing
- Fork it ( https://github.com/vStone/vagrant-blocker )
- Create a new feature branch
- Commit
- Push to your remote
- Create a new Pull Request