mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Check controlpersist (#17443)
* Add a new config option to cache the check for controlpersist on the control machine. Fixes #15844 * Remove the option and make the behavior the default * Make the check for controlpersist cache its status per-ssh executable
This commit is contained in:
parent
2077e32ddd
commit
6117e1946e
4 changed files with 59 additions and 8 deletions
|
@ -28,6 +28,7 @@ from ansible.playbook import Playbook
|
|||
from ansible.template import Templar
|
||||
from ansible.utils.helpers import pct_to_int
|
||||
from ansible.utils.path import makedirs_safe
|
||||
from ansible.utils.ssh_functions import check_for_controlpersist
|
||||
|
||||
try:
|
||||
from __main__ import display
|
||||
|
@ -57,6 +58,14 @@ class PlaybookExecutor:
|
|||
else:
|
||||
self._tqm = TaskQueueManager(inventory=inventory, variable_manager=variable_manager, loader=loader, options=options, passwords=self.passwords)
|
||||
|
||||
# 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.
|
||||
check_for_controlpersist(C.ANSIBLE_SSH_EXECUTABLE)
|
||||
|
||||
def run(self):
|
||||
|
||||
'''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue