provisioners/ansible: use the first private key

/cc @gildegoma - Does Ansible support multiple private keys? Vagrant
now does, so this isn't exactly safe.
This commit is contained in:
Mitchell Hashimoto 2013-11-26 10:07:45 -08:00
parent c5018c5e01
commit cd106986b4
1 changed files with 5 additions and 2 deletions

View File

@ -4,8 +4,11 @@ module VagrantPlugins
def provision
ssh = @machine.ssh_info
# Connect with Vagrant user (unless --user or --private-key are overidden by 'raw_arguments')
options = %W[--private-key=#{ssh[:private_key_path]} --user=#{ssh[:username]}]
# Connect with Vagrant user (unless --user or --private-key are
# overidden by 'raw_arguments').
#
# TODO: multiple private key support
options = %W[--private-key=#{ssh[:private_key_path][0]} --user=#{ssh[:username]}]
# Joker! Not (yet) supported arguments can be passed this way.
options << "#{config.raw_arguments}" if config.raw_arguments