Vagrant Provisioner Babushka
A Vagrant plugin which allows virtual machines to be provisioned using Babushka.
Based on a plugin concept by @tcurdt.
Requirements
- Vagrant 1.1+
- cURL on the virtual machine (will be installed if missing on Ubuntu)
Note: The latest version of this plugin has only been tested on Ubuntu virtual machines. Please open a GitHub issue if it doesn't work for you or your operating system.
Installation
vagrant plugin install vagrant-babushka
Usage
Add a Babushka provision block to your project's Vagrantfile:
config.vm.provision :babushka do |babushka|
# Set the Git branch of Babushka to install on the guest (defaults to master)
babushka.bootstrap_branch = 'master'
# ...or set the URL of the bootstrap script directly
babushka.bootstrap_url = 'https://example.com/babushka-bootstrap'
# Share a directory of local Babushka deps with the VM
# This example shares the '.deps/' directory (relative to this
# Vagrantfile) to '~/babushka-deps' on the guest machine (in the home
# directory of the main SSH user on the guest)
babushka.local_deps_path = '.deps'
# Meet a local dep
# Assuming a dep named 'htop' is defined in a file under './.deps'
babushka.meet 'htop'
# Meet a remote dep
# Assuming source 'tcurdt' has a dep named 'rbenv system'
babushka.meet 'rbenv system', :source => 'tcurdt'
# Also, you can set values for deps' parameters
babushka.meet 'rbenv system', :params => {:key => "value"}
# ...and for remote deps:
babushka.meet 'rbenv system', :source => 'tcurdt', :params => {:key => "value"}
# When run_with_sudo option set to true
# provision will run babushka command with 'sudo' prefix
# on guest machine for this dep
babushka.meet 'postgres', :params => {:version => '9.3'}, :run_with_sudo => true
# Old, **DEPRECATED**, but working syntax
# Meet a local dep
# Assuming a dep named 'htop' is defined in a file under './.deps'
babushka.local_dep 'htop'
# Meet a remote dep
# Assuming source 'tcurdt' has a dep named 'rbenv system'
babushka.remote_dep 'tcurdt', 'rbenv system'
# Also, you can set values for deps' parameters, using a hash as the last parameter
babushka.remote_dep 'tcurdt', 'rbenv system', :path => '/opt/rbenv'
# Set options for the Babushka run
# Enable/disable colorised (ANSI) output from Babushka
# The default value is inherited from Vagrant's current setting
babushka.color = true
# Enable Babushka's debug mode (defaults to false)
babushka.debug = true
# Only do a "dry run", don't meet any deps (defaults to false)
babushka.dry_run = true
# Show parameter values passed to deps (defaults to false)
babushka.show_args = true
# Enable silent mode, no output (defaults to false)
babushka.silent = true
# Enable/disable updating sources before running their deps (defaults to true)
babushka.update = false
# These options can be overridden on particular deps, for example:
babushka.meet 'rbenv system', :source => 'tcurdt', :update => false
babushka.meet 'htop', :color => false
end
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Testing
bundle install
bundle exec rspec
Thanks
patcon
wakeless
Val
bradfeehan
License
MIT