Ansible: Re-enable ControlPersist defaults when ANSIBLE_SSH_ARGS is used

Solve problem discussed in [GH-2952]
This commit is contained in:
Gilles Cornu 2014-03-09 22:41:36 +01:00
parent fa537740c6
commit 1c0bc20d21
1 changed files with 9 additions and 0 deletions

View File

@ -189,6 +189,15 @@ module VagrantPlugins
# SSH Forwarding
ssh_options << "-o ForwardAgent=yes" if @ssh_info[:forward_agent]
# Re-enable ControlPersist Ansible defaults,
# which are lost when ANSIBLE_SSH_ARGS is defined.
unless ssh_options.empty?
ssh_options << "-o ControlMaster=auto"
ssh_options << "-o ControlPersist=60s"
# Intentionally keep ControlPath undefined to let ansible-playbook
# automatically sets this option to Ansible default value
end
ssh_options.join(' ')
end