mitogen icon indicating copy to clipboard operation
mitogen copied to clipboard

Ansible 10 + mitogen_linear + reset_connection fails

Open moreati opened this issue 1 year ago • 1 comments

meta: reset_connection fails in combination with strategy: mitogen_linear and ansible_host_key_checking: true. The same combination works with vanilla Ansible (strategy: linear)

[targets]
hkc-true ansible_host=localhost ansible_host_key_checking=true
- hosts: targets
  gather_facts: false
  tasks:
    - meta: reset_connection
$ ANSIBLE_STRATEGY=mitogen_linear ../../.tox/py312-mode_ansible-ansible10/bin/ansible-playbook -i mrc.ini mrc.yml 
/home/alex/src/mitogen/.tox/py312-mode_ansible-ansible10/lib/python3.12/site-packages/paramiko/pkey.py:59: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.
  'cipher': algorithms.TripleDES,

PLAY [targets] *********************************************************************************************************

TASK [meta _raw_params=reset_connection] *******************************************************************************
Tuesday 06 August 2024  09:46:09 +0000 (0:00:00.060)       0:00:00.060 ******** 
ERROR! Host key checking is enabled, and SSH reported an unrecognized or mismatching host key.
$ ../../.tox/py312-mode_ansible-ansible10/bin/ansible-playbook -i mrc.ini mrc.yml 
/home/alex/src/mitogen/.tox/py312-mode_ansible-ansible10/lib/python3.12/site-packages/paramiko/pkey.py:59: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.
  'cipher': algorithms.TripleDES,

PLAY [targets] *********************************************************************************************************

TASK [meta _raw_params=reset_connection] *******************************************************************************
Tuesday 06 August 2024  09:46:30 +0000 (0:00:00.015)       0:00:00.015 ******** 

PLAY RECAP *************************************************************************************************************

Tuesday 06 August 2024  09:46:30 +0000 (0:00:00.005)       0:00:00.020 ******** 
=============================================================================== 
meta ------------------------------------------------------------------------------------------------------------ 0.01s
Playbook run took 0 days, 0 hours, 0 minutes, 0 seconds
  • Which version of Ansible are you running? 2.10

  • Is your version of Ansible patched in any way? no

  • Are you running with any custom modules, or module_utils loaded? no

  • Have you tried the latest master version from Git? yes (0.3.9dev0)

refs #1074

moreati avatar Aug 06 '24 10:08 moreati

I suspect the following sequence/factors

  • Mitogen is not shortcircuiting the meta action correctly, on the controller
  • Ansible is attempting to discover the target python interpreter
  • Ansible 9 dealt with the failure to connect/discover by using a fallback interpreter (e.g. /usr/bin/python)
  • Ansible 10 no longer performs the fallback, so failure to discover is treated as host unreachable

moreati avatar Aug 06 '24 10:08 moreati