summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatt Martz <matt@sivel.net>2022-09-21 11:35:31 -0500
committerGitHub <noreply@github.com>2022-09-21 11:35:31 -0500
commitc71fdadadb6c2b31459515bed68b1dc47d7a568e (patch)
tree3a1f5972eafe2e1d2f423b9e8d554fb7478ccc3a /lib
parent3b937123d26473b7005674b8915423e3f38f6105 (diff)
downloadansible-c71fdadadb6c2b31459515bed68b1dc47d7a568e.tar.gz
[stable-2.14] Add ssh_args and friends back, add var for proxy_command (#78826) (#78836)
* [stable-2.14] Add ssh_args and friends back, add var for proxy_command (#78826) Fixes #78750 (cherry picked from commit 1b47def) Co-authored-by: Matt Martz <matt@sivel.net> * Remove non-backportable changes
Diffstat (limited to 'lib')
-rw-r--r--lib/ansible/plugins/connection/paramiko_ssh.py47
1 files changed, 43 insertions, 4 deletions
diff --git a/lib/ansible/plugins/connection/paramiko_ssh.py b/lib/ansible/plugins/connection/paramiko_ssh.py
index 82eae5c77e..c2b2d3dc3d 100644
--- a/lib/ansible/plugins/connection/paramiko_ssh.py
+++ b/lib/ansible/plugins/connection/paramiko_ssh.py
@@ -79,6 +79,45 @@ DOCUMENTATION = """
env: [{name: ANSIBLE_PARAMIKO_PROXY_COMMAND}]
ini:
- {key: proxy_command, section: paramiko_connection}
+ ssh_args:
+ description: Only used in parsing ProxyCommand for use in this plugin.
+ default: ''
+ ini:
+ - section: 'ssh_connection'
+ key: 'ssh_args'
+ env:
+ - name: ANSIBLE_SSH_ARGS
+ vars:
+ - name: ansible_ssh_args
+ version_added: '2.7'
+ ssh_common_args:
+ description: Only used in parsing ProxyCommand for use in this plugin.
+ ini:
+ - section: 'ssh_connection'
+ key: 'ssh_common_args'
+ version_added: '2.7'
+ env:
+ - name: ANSIBLE_SSH_COMMON_ARGS
+ version_added: '2.7'
+ vars:
+ - name: ansible_ssh_common_args
+ cli:
+ - name: ssh_common_args
+ default: ''
+ ssh_extra_args:
+ description: Only used in parsing ProxyCommand for use in this plugin.
+ vars:
+ - name: ansible_ssh_extra_args
+ env:
+ - name: ANSIBLE_SSH_EXTRA_ARGS
+ version_added: '2.7'
+ ini:
+ - key: ssh_extra_args
+ section: ssh_connection
+ version_added: '2.7'
+ cli:
+ - name: ssh_extra_args
+ default: ''
pty:
default: True
description: 'SUDO usually requires a PTY, True to give a PTY and False to not give a PTY.'
@@ -267,9 +306,9 @@ class Connection(ConnectionBase):
proxy_command = None
# Parse ansible_ssh_common_args, specifically looking for ProxyCommand
ssh_args = [
- getattr(self._play_context, 'ssh_extra_args', '') or '',
- getattr(self._play_context, 'ssh_common_args', '') or '',
- getattr(self._play_context, 'ssh_args', '') or '',
+ self.get_option('ssh_extra_args'),
+ self.get_option('ssh_common_args'),
+ self.get_option('ssh_args', ''),
]
args = self._split_ssh_args(' '.join(ssh_args))
@@ -287,7 +326,7 @@ class Connection(ConnectionBase):
if proxy_command:
break
- proxy_command = proxy_command or self.get_option('proxy_command')
+ proxy_command = self.get_option('proxy_command') or proxy_command
sock_kwarg = {}
if proxy_command: