Removed deprecated DEFAULT_TRANSPORT smart option (#85810)

* Removed deprecated DEFAULT_TRANSPORT smart option

Removes the logic for handling `DEFAULT_TRANSPORT` set to `smart`.

* Remove unused import
pull/85808/head
Jordan Borean 3 months ago committed by GitHub
parent c59db5349e
commit 94c78cb38f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,4 @@
removed_features:
- >-
Removed the option to set the ``DEFAULT_TRANSPORT`` configuration to ``smart`` that selects the default transport
as either ``ssh`` or ``paramiko`` based on the underlying platform configuraton.

@ -1215,7 +1215,6 @@ DEFAULT_TRANSPORT:
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}

@ -31,7 +31,6 @@ from ansible.utils.helpers import pct_to_int
from ansible.utils.collection_loader import AnsibleCollectionConfig
from ansible.utils.collection_loader._collection_finder import _get_collection_name_from_path, _get_collection_playbook_path
from ansible.utils.path import makedirs_safe
from ansible.utils.ssh_functions import set_default_transport
from ansible.utils.display import Display
@ -65,14 +64,6 @@ class PlaybookExecutor:
forks=context.CLIARGS.get('forks'),
)
# Note: We run this here to cache whether the default ansible ssh
# executable supports control persist. Sometime in the future we may
# need to enhance this to check that ansible_ssh_executable specified
# in inventory is also cached. We can't do this caching at the point
# where it is used (in task_executor) because that is post-fork and
# therefore would be discarded after every task.
set_default_transport()
def run(self):
"""
Run the given playbook, based on the settings in the play which

@ -967,9 +967,6 @@ class TaskExecutor:
self._play_context.connection = current_connection
# TODO: play context has logic to update the connection for 'smart'
# (default value, will chose between ssh and paramiko) and 'persistent'
# (really paramiko), eventually this should move to task object itself.
conn_type = self._play_context.connection
connection, plugin_load_context = self._shared_loader_obj.connection_loader.get_with_context(

@ -20,9 +20,7 @@ from __future__ import annotations
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 as paramiko
from ansible.utils.display import Display
display = Display()
@ -50,20 +48,3 @@ def check_for_controlpersist(ssh_executable):
_HAS_CONTROLPERSIST[ssh_executable] = has_cp
return has_cp
def set_default_transport():
# deal with 'smart' connection .. one time ..
if C.DEFAULT_TRANSPORT == 'smart':
display.deprecated(
msg="The `smart` option for connections is deprecated.",
version="2.20",
help_text="Set the connection plugin directly instead.",
)
# see if SSH can support ControlPersist if not use paramiko
if not check_for_controlpersist('ssh') and paramiko is not None:
C.DEFAULT_TRANSPORT = "paramiko"
else:
C.DEFAULT_TRANSPORT = "ssh"

@ -231,7 +231,6 @@ test/integration/targets/ansible-test-sanity-pylint/deprecated_thing.py pylint:a
test/integration/targets/ansible-test-sanity-pylint/deprecated_thing.py pylint:ansible-deprecated-collection-name-not-permitted # required to verify plugin against core
lib/ansible/galaxy/api.py pylint:ansible-deprecated-version # TODO: 2.20
lib/ansible/utils/encrypt.py pylint:ansible-deprecated-version # TODO: 2.20
lib/ansible/utils/ssh_functions.py pylint:ansible-deprecated-version # TODO: 2.20
lib/ansible/vars/manager.py pylint:ansible-deprecated-version-comment # TODO: 2.20
lib/ansible/vars/plugins.py pylint:ansible-deprecated-version # TODO: 2.20
lib/ansible/galaxy/role.py pylint:ansible-deprecated-python-version-comment # TODO: 2.20

Loading…
Cancel
Save