|
|
@ -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):
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|