paramiko_ssh: remove deprecated ssh_*_args parameters (#82988)

* removed ssh_args parameter
* removed ssh_extra_args parameter
* removed ssh_common_args parameter

Fixes: #82939
Fixes: #82940
Fixes: #82941

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/82979/head
Abhijeet Kasurde 8 months ago committed by GitHub
parent 14a2f6e2ab
commit 92feda2e13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
removed_features:
- paramiko_ssh - removed deprecated ssh_extra_args from the paramiko_ssh connection plugin (https://github.com/ansible/ansible/issues/82941).
- paramiko_ssh - removed deprecated ssh_common_args from the paramiko_ssh connection plugin (https://github.com/ansible/ansible/issues/82940).
- paramiko_ssh - removed deprecated ssh_args from the paramiko_ssh connection plugin (https://github.com/ansible/ansible/issues/82939).

@ -111,8 +111,7 @@ DOCUMENTATION = """
proxy_command:
default: ''
description:
- Proxy information for running the connection via a jumphost
- Also this plugin will scan 'ssh_args', 'ssh_extra_args' and 'ssh_common_args' from the 'ssh' plugin settings for proxy information if set.
- Proxy information for running the connection via a jumphost.
type: string
env: [{name: ANSIBLE_PARAMIKO_PROXY_COMMAND}]
ini:
@ -120,60 +119,6 @@ DOCUMENTATION = """
vars:
- name: ansible_paramiko_proxy_command
version_added: '2.15'
ssh_args:
description: Only used in parsing ProxyCommand for use in this plugin.
default: ''
type: string
ini:
- section: 'ssh_connection'
key: 'ssh_args'
env:
- name: ANSIBLE_SSH_ARGS
vars:
- name: ansible_ssh_args
version_added: '2.7'
deprecated:
why: In favor of the "proxy_command" option.
version: "2.18"
alternatives: proxy_command
ssh_common_args:
description: Only used in parsing ProxyCommand for use in this plugin.
type: string
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: ''
deprecated:
why: In favor of the "proxy_command" option.
version: "2.18"
alternatives: proxy_command
ssh_extra_args:
description: Only used in parsing ProxyCommand for use in this plugin.
type: string
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: ''
deprecated:
why: In favor of the "proxy_command" option.
version: "2.18"
alternatives: proxy_command
pty:
default: True
description: 'SUDO usually requires a PTY, True to give a PTY and False to not give a PTY.'
@ -399,30 +344,7 @@ class Connection(ConnectionBase):
self._log_channel = name
def _parse_proxy_command(self, port: int = 22) -> dict[str, t.Any]:
proxy_command = None
# Parse ansible_ssh_common_args, specifically looking for ProxyCommand
ssh_args = [
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))
for i, arg in enumerate(args):
if arg.lower() == 'proxycommand':
# _split_ssh_args split ProxyCommand from the command itself
proxy_command = args[i + 1]
else:
# ProxyCommand and the command itself are a single string
match = SETTINGS_REGEX.match(arg)
if match:
if match.group(1).lower() == 'proxycommand':
proxy_command = match.group(2)
if proxy_command:
break
proxy_command = self.get_option('proxy_command') or proxy_command
proxy_command = self.get_option('proxy_command') or None
sock_kwarg = {}
if proxy_command:

Loading…
Cancel
Save