From 04b65020acd3c7cb47d1197a46aa67841a68f60c Mon Sep 17 00:00:00 2001 From: David Wilson Date: Fri, 22 Jun 2018 16:31:55 +0100 Subject: [PATCH] issue #278: ansible: support mitogen_ssh_debug_level variable. --- ansible_mitogen/connection.py | 6 ++++++ docs/ansible.rst | 2 ++ 2 files changed, 8 insertions(+) diff --git a/ansible_mitogen/connection.py b/ansible_mitogen/connection.py index 6a6f387e..7c3f59c5 100644 --- a/ansible_mitogen/connection.py +++ b/ansible_mitogen/connection.py @@ -83,6 +83,7 @@ def _connect_ssh(spec): 'ssh_path': spec['ssh_executable'], 'connect_timeout': spec['ansible_ssh_timeout'], 'ssh_args': spec['ssh_args'], + 'ssh_debug_level': spec['mitogen_ssh_debug_level'], } } @@ -260,6 +261,7 @@ def config_from_play_context(transport, inventory_name, connection): 'mitogen_docker_path': connection.mitogen_docker_path, 'mitogen_lxc_info_path': connection.mitogen_lxc_info_path, 'mitogen_machinectl_path': connection.mitogen_machinectl_path, + 'mitogen_ssh_debug_level': connection.mitogen_ssh_debug_level, } @@ -334,6 +336,9 @@ class Connection(ansible.plugins.connection.ConnectionBase): #: Set to 'mitogen_lxc_info_path' by on_action_run(). mitogen_machinectl_path = None + #: Set to 'mitogen_ssh_debug_level' by on_action_run(). + mitogen_ssh_debug_level = None + #: Set to 'inventory_hostname' by on_action_run(). inventory_hostname = None @@ -374,6 +379,7 @@ class Connection(ansible.plugins.connection.ConnectionBase): self.mitogen_docker_path = task_vars.get('mitogen_docker_path') self.mitogen_lxc_info_path = task_vars.get('mitogen_lxc_info_path') self.mitogen_machinectl_path = task_vars.get('mitogen_machinectl_path') + self.mitogen_ssh_debug_level = task_vars.get('mitogen_ssh_debug_level') self.inventory_hostname = task_vars['inventory_hostname'] self.host_vars = task_vars['hostvars'] self.close(new_task=True) diff --git a/docs/ansible.rst b/docs/ansible.rst index be615375..b7502586 100644 --- a/docs/ansible.rst +++ b/docs/ansible.rst @@ -619,6 +619,8 @@ except connection delegation is supported. * ``ansible_ssh_private_key_file`` * ``ansible_ssh_pass``, ``ansible_password`` (default: assume passwordless) * ``ssh_args``, ``ssh_common_args``, ``ssh_extra_args`` +* ``mitogen_ssh_debug_level``: integer between `0..3` indicating the SSH client + debug level. Ansible must also be run with '-vvv' to view the output. Debugging