Skip to content

Commit

Permalink
(BKR-1423) Pick up Vagrant config for rsync
Browse files Browse the repository at this point in the history
Ensure that rsync connections use the on-disk Vagrant SSH configuraiton
if an alternate physical SSH configuration has not been specified.

Correlates directly with voxpupuli/beaker-vagrant#28
  • Loading branch information
trevor-vaughan committed Mar 18, 2020
1 parent aee55af commit 56c66ed
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/beaker/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,17 @@ def do_rsync_to from_path, to_path, opts = {}

# vagrant uses temporary ssh configs in order to use dynamic keys
# without this config option using ssh may prompt for password
if ssh_opts[:config] and File.exists?(ssh_opts[:config])
ssh_args << "-F #{ssh_opts[:config]}"
#
# We still want any user-set SSH config to win though
filesystem_ssh_config = nil
if ssh_opts[:config] && File.exists?(ssh_opts[:config])
filesystem_ssh_config = ssh_opts[:config]
elsif self[:vagrant_ssh_config] && File.exists?(self[:vagrant_ssh_config])
filesystem_ssh_config = self[:vagrant_ssh_config]
end

if filesystem_ssh_config
ssh_args << "-F #{filesystem_ssh_config}"
else
if ssh_opts.has_key?('keys') and
ssh_opts.has_key?('auth_methods') and
Expand Down

0 comments on commit 56c66ed

Please sign in to comment.