minimal patch to support ansible-core 2.11

Ansible no longer exposes the ssh connection plugin options
as play_context attributes. Instead we fetch the values
directly from the Ansible config system.

See https://github.com/ansible/ansible/pull/73708
pull/841/head
Claude Becker 5 years ago
parent 36f3e3b28c
commit 37e33106ae

@ -45,7 +45,7 @@ __all__ = [
import ansible
ANSIBLE_VERSION_MIN = (2, 10)
ANSIBLE_VERSION_MAX = (2, 10)
ANSIBLE_VERSION_MAX = (2, 11)
NEW_VERSION_MSG = (
"Your Ansible version (%s) is too recent. The most recent version\n"

@ -451,7 +451,7 @@ class PlayContextSpec(Spec):
return self._play_context.private_key_file
def ssh_executable(self):
return self._play_context.ssh_executable
return C.config.get_config_value("ssh_executable", plugin_type="connection", plugin_name="ssh")
def timeout(self):
return self._play_context.timeout
@ -467,9 +467,9 @@ class PlayContextSpec(Spec):
return [
mitogen.core.to_text(term)
for s in (
getattr(self._play_context, 'ssh_args', ''),
getattr(self._play_context, 'ssh_common_args', ''),
getattr(self._play_context, 'ssh_extra_args', '')
C.config.get_config_value("ssh_args", plugin_type="connection", plugin_name="ssh"),
C.config.get_config_value("ssh_common_args", plugin_type="connection", plugin_name="ssh"),
C.config.get_config_value("ssh_extra_args", plugin_type="connection", plugin_name="ssh")
)
for term in ansible.utils.shlex.shlex_split(s or '')
]

Loading…
Cancel
Save