Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vagrant up should fail gracefully when .ssh/id_rsa is missing #592

Closed
nicolaiskogheim opened this issue Jun 9, 2017 · 0 comments
Closed

Comments

@nicolaiskogheim
Copy link

Versions

  • Vagrant: Vagrant 1.9.5
  • Provider: Oracle VM VirtualBox Manager 5.1.22
  • Homestead: v5.3.2 (the checked out tag. Don't have the homestead command)

Host operating system

Arch Linux 4.9.30-1-lts #1 SMP Sun May 28 18:47:29 CEST 2017 x86_64 GNU/Linux

Homestead.yaml

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Code
      to: /home/vagrant/Code

sites:
    - map: homestead.app
      to: /home/vagrant/Code/Laravel/public

databases:
    - homestead

Vagrant up output

https://gist.github.com/nicolaiskogheim/949ffbe3a065917f2611747aec7c3a1c

Expected behavior

Vagrant should have told me that the keys specified in homestead.yml doesn't exist.

Actual behavior

Stacktrace when ruby wasn't able to read the file.

In scripts/homestead.yml:118 the keys from homestead.yml is read, but there is no error checking.

### scripts/homestead.rb:112
        # Copy The SSH Private Keys To The Box
        if settings.include? 'keys'
            settings["keys"].each do |key|
                config.vm.provision "shell" do |s|
                    s.privileged = false
                    s.inline = "echo \"$1\" > /home/vagrant/.ssh/$2 && chmod 600 /home/vagrant/.ssh/$2"
                    s.args = [File.read(File.expand_path(key)), key.split('/').last]
                end
            end
        end

Steps to reproduce

  1. Install homestead
  2. Ensure there is no ~/.ssh/id_rsa file present
  3. run vagrant up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant