tknerr / vagrant-managed-servers

Enables Vagrant to ssh into and provision managed servers
MIT License
185 stars 30 forks source link

The following SSH command responded with a non zero exit status #69

Open arimourao opened 7 years ago

arimourao commented 7 years ago

I'm trying to provision a server with my puphpet configuration. I can link with my remote server but then I get the following error when running vagrant provision

Bringing machine 'default' up with 'managed' provider... ==> default: The managed server is already linked. ari@debian:~/Documents/vagrant_provision_dev_server$ vagrant provision ==> default: Rsyncing folder: /home/ari/Documents/vagrant_provision_dev_server/ => /vagrant The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!

mkdir -p /vagrant

Stdout from the command:

Stderr from the command:

sudo: nenhum tty presente e nenhum programa de askpass especificado

Here is my Vagrantfile:

# -*- mode: ruby -*-

dir = File.dirname(File.expand_path(__FILE__))

require 'yaml'
require "#{dir}/puphpet/ruby/deep_merge.rb"
require "#{dir}/puphpet/ruby/to_bool.rb"
require "#{dir}/puphpet/ruby/puppet.rb"

configValues = YAML.load_file("#{dir}/puphpet/config.yaml")

data = configValues['vagrantfile']

Vagrant.configure('2') do |config|
  config.vm.box = "tknerr/managed-server-dummy"
  config.vm.provider :managed do |managed, override|
    managed.server = "10.1.1.64"
    override.ssh.username = "inovarti"
    override.ssh.private_key_path = "~/.ssh/id_rsa"
  end
end

I can ssh normally into the server with this same user and with this same id_rsa in terminal.

arimourao commented 7 years ago

Ok, I solved this one. You have to ssh into the remote server and include your username in the sudoers that don't have to type passwords. This should be mentionated in the docs, it would give people a LOT less headaches. More info in this thread:

https://github.com/mitchellh/vagrant/issues/1659

arimourao commented 7 years ago

I still have one doubt. I was looking for a way to install all dependencies listed in my puphpet script into my remote server. But I only got my local vagrant folder rsynced to a /vagrant folder. Is this the expected result?

tknerr commented 7 years ago

Glad you solved the earlier issue, and yes it might be good to mention this in the docs, if that was not implicitly clear.

Regarding the puphpet scripts: if they are in the same directory as the Vagrantfile they should definitely be synced to /vagrant on the remote host.

If they are outside of that directory you could add another synced folder definition to also sync them: https://www.vagrantup.com/docs/synced-folders/rsync.html

Am 09.12.2016 8:13 nachm. schrieb "Ari Mourao" notifications@github.com:

I still have one doubt. I was looking for a way to install all dependencies listed in my puphpet script into my remote server. But I only got my local vagrant folder rsynced to a /vagrant folder. Is this the expected result?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tknerr/vagrant-managed-servers/issues/69#issuecomment-266096631, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWUsHsui5szgT9EMjtAuzeUiBsruf76ks5rGag9gaJpZM4LJPlS .