Search code examples
sshvagrantchef-infratest-kitchen

Cannot Login Into Vagrant boxes managed via Test Kitchen


I have a very boiler plate .kitchen.yml with the following:

---
driver:
  name: vagrant
platforms:
  - name: ubuntu-14.04
suites:
   - name: default
   run_list:
    - recipe[webserver::default]

when I run kitchen converge I get the following:

==> default: Setting hostname...
   ==> default: Replaced insecure vagrant key with less insecure key!
   ==> default: Machine not provisioned because `--no-provision` is specified.
   Waiting for SSH service on 127.0.0.1:2222, retrying in 3 seconds
   Waiting for SSH service on 127.0.0.1:2222, retrying in 3 seconds
   Waiting for SSH service on 127.0.0.1:2222, retrying in 3 seconds
   .....
   ......

After quit a bit of googling, I've read that Vagrant 1.7+ replaces the default ssh key with what they think is a less insecure key.

There's the config.ssh.insert_key = false but that won't work for the following reasons:

  1. Updated kitchen.yml with insert_key = false

    1.1 This does not work because the Vagrantfile produced has the boolean false as a "false" string!

  2. Tried using a Global Vagrantfile file

    2.1 This did not work as if the file isn't even read!

  3. Tried to build my own box but didn't succeed.

Anyone manage to fix or have a work around for this?


Solution

  • I downgraded from vagrant to 1.8.4 from 1.8.5 and it worked.

    I had to run kitchen destroy blah to remove the instance created with 1.8.5. Then when I rand kitchen converge blah it worked.