fix configurable pipelining (#69920)
* fix configurable pipelining Co-authored-by: Sloane Hertel <shertel@redhat.com>
This commit is contained in:
parent
4a4a11d282
commit
8c3eb7ae4a
3 changed files with 28 additions and 16 deletions
2
changelogs/fragments/configurable_pipelining.yml
Normal file
2
changelogs/fragments/configurable_pipelining.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- match docs for ssh and ensure pipelining is configurable per connection plugin.
|
|
@ -300,20 +300,30 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
||||||
Determines if we are required and can do pipelining
|
Determines if we are required and can do pipelining
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
try:
|
||||||
|
is_enabled = self._connection.get_option('pipelining')
|
||||||
|
except (KeyError, AttributeError, ValueError):
|
||||||
|
is_enabled = self._play_context.pipelining
|
||||||
|
|
||||||
|
# winrm supports async pipeline
|
||||||
|
# TODO: make other class property 'has_async_pipelining' to separate cases
|
||||||
|
always_pipeline = self._connection.always_pipeline_modules
|
||||||
|
|
||||||
|
# su does not work with pipelining
|
||||||
|
# TODO: add has_pipelining class prop to become plugins
|
||||||
|
become_exception = (self._connection.become.name if self._connection.become else '') != 'su'
|
||||||
|
|
||||||
# any of these require a true
|
# any of these require a true
|
||||||
for condition in [
|
conditions = [
|
||||||
self._connection.has_pipelining,
|
self._connection.has_pipelining, # connection class supports it
|
||||||
self._play_context.pipelining or self._connection.always_pipeline_modules, # pipelining enabled for play or connection requires it (eg winrm)
|
is_enabled or always_pipeline, # enabled via config or forced via connection (eg winrm)
|
||||||
module_style == "new", # old style modules do not support pipelining
|
module_style == "new", # old style modules do not support pipelining
|
||||||
not C.DEFAULT_KEEP_REMOTE_FILES, # user wants remote files
|
not C.DEFAULT_KEEP_REMOTE_FILES, # user wants remote files
|
||||||
not wrap_async or self._connection.always_pipeline_modules, # async does not normally support pipelining unless it does (eg winrm)
|
not wrap_async or always_pipeline, # async does not normally support pipelining unless it does (eg winrm)
|
||||||
(self._connection.become.name if self._connection.become else '') != 'su', # su does not work with pipelining,
|
become_exception,
|
||||||
# FIXME: we might need to make become_method exclusion a configurable list
|
]
|
||||||
]:
|
|
||||||
if not condition:
|
|
||||||
return False
|
|
||||||
|
|
||||||
return True
|
return all(conditions)
|
||||||
|
|
||||||
def _get_admin_users(self):
|
def _get_admin_users(self):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -200,12 +200,12 @@ DOCUMENTATION = '''
|
||||||
which is why this feature is disabled by default.
|
which is why this feature is disabled by default.
|
||||||
env:
|
env:
|
||||||
- name: ANSIBLE_PIPELINING
|
- name: ANSIBLE_PIPELINING
|
||||||
#- name: ANSIBLE_SSH_PIPELINING
|
- name: ANSIBLE_SSH_PIPELINING
|
||||||
ini:
|
ini:
|
||||||
- section: defaults
|
- section: defaults
|
||||||
key: pipelining
|
key: pipelining
|
||||||
#- section: ssh_connection
|
- section: ssh_connection
|
||||||
# key: pipelining
|
key: pipelining
|
||||||
type: boolean
|
type: boolean
|
||||||
vars:
|
vars:
|
||||||
- name: ansible_pipelining
|
- name: ansible_pipelining
|
||||||
|
|
Loading…
Reference in a new issue