Skip to content

Instantly share code, notes, and snippets.

@maxlinc
Forked from brettswift/Vagrantfile
Created July 7, 2014 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxlinc/a42487706295f1007580 to your computer and use it in GitHub Desktop.
Save maxlinc/a42487706295f1007580 to your computer and use it in GitHub Desktop.
EBUG ssh: == Net-SSH connection debug-level log END ==
INFO ssh: SSH is ready!
INFO machine: Calling action: read_ssh_info on provider RackSpace Cloud
INFO runner: Preparing hooks for middleware sequence...
INFO runner: 3 hooks defined.
INFO runner: Running action: #<Vagrant::Action::Builder:0x00000101a59fe0>
INFO warden: Calling IN action: #<PEBuild::Action::PEBuildDir:0x00000101a70740>
INFO warden: Calling IN action: #<AutoNetwork::Action::Request:0x00000101a706a0>
INFO warden: Calling IN action: #<Vagrant::Action::Builtin::ConfigValidate:0x00000101a70448>
INFO warden: Calling IN action: #<VagrantPlugins::Rackspace::Action::ConnectRackspace:0x00000101a703a8>
INFO connect_rackspace: Connecting to Rackspace region...
INFO warden: Calling IN action: #<VagrantPlugins::Rackspace::Action::ReadSSHInfo:0x00000101baaac0>
INFO warden: Calling OUT action: #<VagrantPlugins::Rackspace::Action::ReadSSHInfo:0x00000101baaac0>
INFO warden: Calling OUT action: #<VagrantPlugins::Rackspace::Action::ConnectRackspace:0x00000101a703a8>
INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::ConfigValidate:0x00000101a70448>
INFO warden: Calling OUT action: #<AutoNetwork::Action::Request:0x00000101a706a0>
INFO warden: Calling OUT action: #<PEBuild::Action::PEBuildDir:0x00000101a70740>
INFO interface: info: The server is ready!
INFO interface: info: ==> suite_brettswift_com: The server is ready!
==> suite_brettswift_com: The server is ready!
INFO warden: Calling OUT action: #<VagrantPlugins::Rackspace::Action::CreateServer:0x00000101d03a70>
INFO synced_folders: Invoking synced folder enable: nfs
ERROR warden: Error occurred: No host IP was given to the Vagrant core NFS helper. This is
an internal error that should be reported as a bug.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
ERROR warden: Error occurred: No host IP was given to the Vagrant core NFS helper. This is
an internal error that should be reported as a bug.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
ERROR warden: Error occurred: No host IP was given to the Vagrant core NFS helper. This is
an internal error that should be reported as a bug.
INFO warden: Beginning recovery process...
INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x00000101bb9228>
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO environment: Running hook: environment_unload
INFO runner: Preparing hooks for middleware sequence...
INFO runner: 3 hooks defined.
INFO runner: Running action: #<Vagrant::Action::Builder:0x00000101e985e8>
INFO warden: Calling IN action: #<PEBuild::Action::PEBuildDir:0x00000101ea9d98>
INFO warden: Calling OUT action: #<PEBuild::Action::PEBuildDir:0x00000101ea9d98>
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<Vagrant::Errors::NFSNoHostIP: No host IP was given to the Vagrant core NFS helper. This is
an internal error that should be reported as a bug.>
ERROR vagrant: No host IP was given to the Vagrant core NFS helper. This is
an internal error that should be reported as a bug.
ERROR vagrant: /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/plugins/synced_folders/nfs/synced_folder.rb:42:in `enable'
Vagrant.configure("2") do |config|
config.vm.define :suite_brettswift_com do |nodeserver|
config.vm.provider :rackspace do |rs, override|
override.vm.box = "rackspace"
override.vm.box_url = "https://github.com/mitchellh/vagrant-rackspace/raw/master/dummy.box"
rs.username = "#{ENV['RACKSPACE_USERNAME']}"
rs.api_key = "#{ENV['RACKSPACE_API_KEY']}"
rs.flavor = /512MB Standard Instance/
rs.image = /Ubuntu 12.04/
rs.rackspace_region = 'dfw'
override.ssh.private_key_path = "~/.ssh/id_rsa"
override.ssh.username = 'root'
rs.public_key_path = "~/.ssh/id_rsa.pub"
end
end
end
@maxlinc
Copy link
Author

maxlinc commented Jul 7, 2014

I had to clean this up a to get it working on my machine. This is the cleanest version, IMHO, though the minimal change you can make is just to address point #1 below:

Vagrant.configure("2") do |config|
  config.vm.define :suite_brettswift_com do |nodeserver|
    nodeserver.vm.box               = "rackspace"
    nodeserver.vm.box_url           = "https://github.com/mitchellh/vagrant-rackspace/raw/master/dummy.box"
    nodeserver.ssh.private_key_path = "~/.ssh/id_rsa"
    nodeserver.ssh.username         = 'root'

    nodeserver.vm.provider :rackspace do |rs|
      rs.username                   = ENV['RACKSPACE_USERNAME']
      rs.api_key                    = ENV['RACKSPACE_API_KEY']
      rs.flavor                     = /512MB Standard Instance/  
      rs.image                      = /Ubuntu 12.04/
      rs.rackspace_region           = 'dfw'
      rs.public_key_path            = "~/.ssh/id_rsa.pub"
    end
  end
end

The things I cleaned up where:

  • Use nodeserver.vm.provider instead of config.vm.provider if you're nesting inside the definition for nodeserver. Otherwise, move the rackspace config outside of the block.
  • Don't use override if it's avoidable (I think this is just personal preference - override should work)
  • Since environment variables are strings, you don't need to quote and interpolate them. You can just use:
rs.username                   = ENV['RACKSPACE_USERNAME']
rs.api_key                    = ENV['RACKSPACE_API_KEY']

The first change is the most important. The Vagrantfile doesn't work in my environment without that change. I'm not 100% sure why it works in your env and not mine, but it could be because I tested by downgrading my vagrant version to match yours, but didn't downgrade the bundled ruby (I tested ith ruby 2.1, I think vagrant 1.5.3 uses 2.0). The point is, even if it works for you currently there's a good chance it won't work in future versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment