deprecate 'smart' connection value (#81218)

Co-authored-by: Jordan Borean <jborean93@gmail.com>
pull/81237/head
Brian Coca 3 years ago committed by GitHub
parent 59a791ee3b
commit ee12bafe48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,4 @@
minor_changes:
- DEFAULT_TRANSPORT now defaults to 'ssh', the old 'smart' option is being deprecated as versions of OpenSSH without control persist are basically not present anymore.
deprecated_features:
- the 'smart' option for setting a connection plugin is being removed as it's main purpose (choosing between ssh and paramiko) is now irrelevant.

@ -1102,10 +1102,11 @@ DEFAULT_TIMEOUT:
- {key: timeout, section: defaults}
type: integer
DEFAULT_TRANSPORT:
# note that ssh_utils refs this and needs to be updated if removed
name: Connection plugin
default: smart
description: "Default connection plugin to use, the 'smart' option will toggle between 'ssh' and 'paramiko' depending on controller OS and ssh versions"
default: ssh
description:
- Can be any connection plugin available to your ansible installation.
- There is also a (DEPRECATED) special 'smart' option, that will toggle between 'ssh' and 'paramiko' depending on controller OS and ssh versions.
env: [{name: ANSIBLE_TRANSPORT}]
ini:
- {key: transport, section: defaults}

@ -25,6 +25,9 @@ import subprocess
from ansible import constants as C
from ansible.module_utils.common.text.converters import to_bytes
from ansible.module_utils.compat.paramiko import paramiko
from ansible.utils.display import Display
display = Display()
_HAS_CONTROLPERSIST = {} # type: dict[str, bool]
@ -51,13 +54,11 @@ def check_for_controlpersist(ssh_executable):
return has_cp
# TODO: move to 'smart' connection plugin that subclasses to ssh/paramiko as needed.
def set_default_transport():
# deal with 'smart' connection .. one time ..
if C.DEFAULT_TRANSPORT == 'smart':
# TODO: check if we can deprecate this as ssh w/o control persist should
# not be as common anymore.
display.deprecated("The 'smart' option for connections is deprecated. Set the connection plugin directly instead.", version=2.19)
# see if SSH can support ControlPersist if not use paramiko
if not check_for_controlpersist('ssh') and paramiko is not None:

Loading…
Cancel
Save