Getting familiar with the Vagrant commandline interface
- list the subcommands
vagranthas - show the help / usage instructions for
vagrant init
| D:\Repos\_github\_cookbooks\sample-toplevel-cookbook>stove --category Other -l debug | |
| DL is deprecated, please use Fiddle | |
| Stove::Cli | ===> Options: {:endpoint=>nil, :username=>"tknerr", :key=>"C:\\Users\\tkn\\.chef\\tknerr.pem", :category=>"Other", :remote=>"origin", :branch=>"master", :sign=>false, :log_level=>"debug", :path=>"D:/Repos/_github/_cookbooks/sample-toplevel-cookbook", :version=>nil} | |
| Stove::Cli | ===> ARGV: [] | |
| Stove::Runner | ===> Running plugin `:git' | |
| Stove::Validator | ===> Running validations for `git.repository' | |
| Stove::Validator | Validation repository passed! | |
| Stove::Validator | ===> Running validations for `git.clean' | |
| Stove::Plugin::Git | Running `git status -s 2>NUL', errors: false | |
| Stove::Validator | Validation clean passed! |
| Vagrant.configure("2") do |config| | |
| config.vm.box = "chef/ubuntu-12.04" | |
| # load balancer VM | |
| config.vm.define "lb" do |lb_config| | |
| lb_config.vm.network "private_network", ip: "192.168.40.90" | |
| lb_config.vm.provision "shell", inline: <<-EOF | |
| sudo apt-get update | |
| sudo apt-get install nginx -y |
| Vagrant.configure("2") do |config| | |
| # x64 box works as expected | |
| config.vm.define :works do |c| | |
| c.vm.box = "chef/ubuntu-14.04" | |
| end | |
| # i386 box fails when mounting shared folders | |
| config.vm.define :broken do |c| | |
| c.vm.box = "chef/ubuntu-14.04-i386" |
Various hints I found for properly configuring a Vagrant host-only network with DevStack. The goals are:
Found here: http://askubuntu.com/questions/238040/how-do-i-fix-name-service-for-vagrant-client
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| HOST_IP = "192.168.33.2" | |
| VM_NET = "192.168.27" | |
| Vagrant.configure("2") do |config| | |
| config.vm.box = "ubuntu/trusty64" | |
| # set the hostname, otherwise qrouter will be lost upon reload |
I have the following file structure:
Y:\tmp\test
| main.groovy
|
\---impl
FooImpl.groovy
| #!/bin/bash | |
| if ! command -v ansible >/dev/null; then | |
| echo "Installing Ansible dependencies and Git." | |
| if command -v yum >/dev/null; then | |
| sudo yum install -y git python python-devel | |
| elif command -v apt-get >/dev/null; then | |
| sudo apt-get update -qq | |
| #sudo apt-get install -y -qq git python-yaml python-paramiko python-jinja2 | |
| sudo apt-get install -y -qq git python python-dev |
Long story short, ansible does not work on a Windows control machine, so you basically have to:
ansible --connection=local ... in the target vmBelow are Vagrantfile examples for both approaches
| D:\Repos\_github\gem-vagrant-wrapper>rake test | |
| .....*....F...........FFFF | |
| Pending: | |
| VagrantWrapper#vagrant_version system search path returns a version less than 1.1 | |
| # missing support files | |
| # ./spec/vagrant_wrapper_spec.rb:72 | |
| Failures: |