Sha256: fef67aa65f2fa1c8eb3d0abebd3369130a9d82d5300d45cf096daf9d714a8ccc
Contents?: true
Size: 769 Bytes
Versions: 6
Compression:
Stored size: 769 Bytes
Contents
module Vagrant module Command class SSHConfigCommand < NamedBase class_option :host, :type => :string, :default => nil, :aliases => "-h" register "ssh_config", "outputs .ssh/config valid syntax for connecting to this environment via ssh" def execute raise Errors::MultiVMTargetRequired, :command => "ssh_config" if target_vms.length > 1 vm = target_vms.first raise Errors::VMNotCreatedError if !vm.created? $stdout.puts(Util::TemplateRenderer.render("ssh_config", { :host_key => options[:host] || "vagrant", :ssh_user => vm.env.config.ssh.username, :ssh_port => vm.ssh.port, :private_key_path => vm.env.config.ssh.private_key_path })) end end end end
Version data entries
6 entries across 6 versions & 2 rubygems