mitogen-hq / mitogen

Distributed self-replicating programs in Python
https://mitogen.networkgenomics.com/
BSD 3-Clause "New" or "Revised" License
2.32k stars 197 forks source link

ansible_user and ansible_ssh_host variables not evaluated by mitogen #1022

Open vdanjean opened 1 year ago

vdanjean commented 1 year ago

I reproduce the problem with a small inventory and task file: ansible_user and ansible_ssh_host are defined to a non-constant in the inventory file (group dj):

---
dj:
  hosts:
    aya:
  vars:
    setup_ansible_user_login: vdanjean-ansible-client

    local_ssh_domain: ""
    ansible_ssh_host: "{{ inventory_hostname }}{{ local_ssh_domain }}"

    ansible_user: "{{ setup_ansible_user_login }}"

My test playbook is the following

---

 - name: tests ssh
   hosts: all
   gather_facts: false
   tasks:
     - block:
         - set_fact:
             foo: bar
             #ansible_ssh_host: "{{ ansible_ssh_host }}"
             #ansible_user: "{{ ansible_user }}"
         - command: hostname
           register: res
           ignore_unreachable: true
       always:
         - debug: var=res

As it is, running it with default stategy works. But, with strategy = mitogen_linear, I got:

$ ansible-playbook -vvv -l aya test.yml 
ansible-playbook [core 2.14.9]
  config file = /home/vdanjean/travail/perso/Claire/NGS/gitolite/vdanjean-chu-ansible/bug/ansible.cfg
  configured module search path = ['/home/vdanjean/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/vdanjean/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible-playbook
  python version = 3.11.5 (main, Aug 29 2023, 15:31:31) [GCC 13.2.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
Using /home/vdanjean/travail/perso/Claire/NGS/gitolite/vdanjean-chu-ansible/bug/ansible.cfg as config file
host_list declined parsing /home/vdanjean/travail/perso/Claire/NGS/gitolite/vdanjean-chu-ansible/bug/inventories/dj/hosts.yml as it did not pass its verify_file() method
script declined parsing /home/vdanjean/travail/perso/Claire/NGS/gitolite/vdanjean-chu-ansible/bug/inventories/dj/hosts.yml as it did not pass its verify_file() method
Parsed /home/vdanjean/travail/perso/Claire/NGS/gitolite/vdanjean-chu-ansible/bug/inventories/dj/hosts.yml inventory source with yaml plugin
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: test.yml ***********************************************************************************************************************
1 plays in test.yml

PLAY [tests ssh] *************************************************************************************************************************
[top  962514] 17:08:17.916706 D ansible_mitogen.affinity: CPU mask for Ansible top-level process: 0x000002
[top  962514] 17:08:17.916972 D ansible_mitogen.process: inherited open file limits: soft=1024 hard=1048576
[top  962514] 17:08:17.917050 D ansible_mitogen.process: raised soft open file limit from 1024 to 1048576
[mux  962518] 17:08:17.920227 D ansible_mitogen.affinity: CPU mask for MuxProcess 0: 0x000001
[mux  962518] 17:08:17.929275 D mitogen.service: Pool(1210, size=32, th='MainThread'): initialized
[mux  962518] 17:08:17.930154 D ansible_mitogen.process: Service pool configured: size=32

TASK [set_fact] **************************************************************************************************************************
task path: /home/vdanjean/travail/perso/Claire/NGS/gitolite/vdanjean-chu-ansible/bug/test.yml:8
[task 962552] 17:08:17.951331 D ansible_mitogen.affinity: CPU mask for WorkerProcess: 0x000004
[task 962552] 17:08:17.960562 D ansible_mitogen.mixins: _remove_tmp_path(None)
ok: [aya] => {
    "ansible_facts": {
        "foo": "bar"
    },
    "changed": false
}

TASK [command] ***************************************************************************************************************************
task path: /home/vdanjean/travail/perso/Claire/NGS/gitolite/vdanjean-chu-ansible/bug/test.yml:12
[task 962554] 17:08:17.972096 D ansible_mitogen.affinity: CPU mask for WorkerProcess: 0x000008
<aya> Attempting python interpreter discovery
[task 962554] 17:08:17.981889 D ansible_mitogen.mixins: _low_level_execute_command("echo PLATFORM; uname; echo FOUND; command -v 'python3.11'; command -v 'python3.10'; command -v 'python3.9'; command -v 'python3.8'; command -v 'python3.7'; command -v 'python3.6'; command -v 'python3.5'; command -v '/usr/bin/python3'; command -v '/usr/libexec/platform-python'; command -v 'python2.7'; command -v '/usr/bin/python'; command -v 'python'; echo ENDFOUND", in_data=<class 'NoneType'>, exe=None, dir=None)
[task 962554] 17:08:17.983357 D ansible_mitogen.process: will use multiplexer 0 (/tmp/mitogen_unix_eq9rjudc.sock) to connect to "aya"
[task 962554] 17:08:17.983450 D mitogen.unix: client: connecting to /tmp/mitogen_unix_eq9rjudc.sock
[mux  962518] 17:08:17.984048 D mitogen.unix: listener: accepted connection from PID 962554: unix_client.962554
[task 962554] 17:08:17.983971 D mitogen.unix: client: local ID is 1, remote is 0
[mux  962518] 17:08:17.986592 D mitogen.parent: creating connection to context 2 using mitogen.ssh
[mux  962518] 17:08:18.079913 D mitogen.parent: command line for Connection(None): ssh -o "LogLevel ERROR" -l "{{ setup_ansible_user_login }}" -o "Compression yes" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 10" -o "BatchMode yes" -o "StrictHostKeyChecking yes" -C -o ControlMaster=auto -o ControlPersist=60s "{{ inventory_hostname }}{{ local_ssh_domain }}" /usr/bin/python -c "'import codecs,os,sys;_=codecs.decode;exec(_(_(\"eNqVkl1PgzAUhu/3K7w7bSSsxeg2IonLNj8S9xEyJWYSAqNo3VZIgeH89ZZhNpgXxrs+fd9zzgs9tuZYcaonPGEIt6RW1IhHZwqiWK4QNlvlOcwTAxGNEoKPbGt1kkqlFS/XccqQXQdZB6cOhYJqYC78jRq/IK5lwdCXBRfgi7AuGe7CNNxroL29ku5SnX2yZZ75wZqpqnaeynbARTvZZe+xAPPEcWow9A78e7y6N4hBDwm2TKY8FgvzoqwsW5qqhoktl+oWZi/z++nEe+w/TQb3o6F3a0/HnmP3Z7ORDa4FFPZ/4+Dv23fPRAnN6JVH4Ro1Ba2J54A2PIvfmDC3oS8+mC9u2M5fmb0r45J2MeCWalRInjFENRg/zKeEkFcBKsAyDtVX4tbA8lC5AGGcMKGeHWQAWJfMDxHtkF4Xa/DFE9UpSqyjz9GgCKDciSj5GTDYn6t3PnEXf7l/p6TNlIcNMvA3SxXhug==\".encode(),\"base64\"),\"zip\"))'"
[mux  962518] 17:08:18.087692 D mitogen.parent: child for Connection(None) started: pid:962558 stdin:76 stdout:76 stderr:78
[mux  962518] 17:08:18.094153 D mitogen.parent: ssh.{{ inventory_hostname }}{{ local_ssh_domain }}: (unrecognized): ssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known
[mux  962518] 17:08:18.094543 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 78>: empty read, disconnecting
[mux  962518] 17:08:18.095224 D mitogen: SetupProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.095524 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 76>: empty read, disconnecting
[mux  962518] 17:08:18.095626 D mitogen.parent: failing connection ssh.{{ inventory_hostname }}{{ local_ssh_domain }} due to EofError('EOF on stream; last 100 lines received:\nssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known\r')
[mux  962518] 17:08:18.095769 D mitogen.parent: PopenProcess ssh.{{ inventory_hostname }}{{ local_ssh_domain }} pid 962558: exited with return code 255
[mux  962518] 17:08:18.095835 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.096030 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[task 962554] 17:08:18.096838 D ansible_mitogen.process: will use multiplexer 0 (/tmp/mitogen_unix_eq9rjudc.sock) to connect to "aya"
[mux  962518] 17:08:18.097788 D mitogen.parent: creating connection to context 3 using mitogen.ssh
[mux  962518] 17:08:18.099301 D mitogen.parent: command line for Connection(None): ssh -o "LogLevel ERROR" -l "{{ setup_ansible_user_login }}" -o "Compression yes" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 10" -o "BatchMode yes" -o "StrictHostKeyChecking yes" -C -o ControlMaster=auto -o ControlPersist=60s "{{ inventory_hostname }}{{ local_ssh_domain }}" python3 -c "'import codecs,os,sys;_=codecs.decode;exec(_(_(\"eNqVkl9PgzAUxd/3KXy7bSSsxegckcRlm87E/QmZEjMJgVG0biukwHB+esswG8wH41t/Pefee6DX1hwrTvWEJwzhltSKGvHoTEEUyxXCZqs8h3liIKJRQvCRba1OUqm04uU6Thmy6yDr4NShUFANzIW/UeMXxLUsGPiy4AJ8EdYlw12YhnsDtLtX0l2qs0+2zDM/WDNV1c5T2Q64aCe77D0WYJ44Tg2G3oF/j1f3BjHoIcGWyZTHYmFelJVlS1PVMLHlUt3C7GU+mk68x97TpD8aDrw7ezr2HLs3mw1tcC2gsP8bB3/Pvn8mSmhGrzwK16gpaE08B7ThWfzGhLkNffHBfHHLdv7K7F4Zl/QaA26pRoXkGUNUg/HDfEoIeRWgAizjUH0lbvUtD5ULEMYJE+rZQQaAdcn8ENEO6XawBl88UZ2ixDr6HA2KAMqdiJKfAf39uXrnE3fxl/t3StpMedggA38DSoPhuQ==\".encode(),\"base64\"),\"zip\"))'"
[mux  962518] 17:08:18.106351 D mitogen.parent: child for Connection(None) started: pid:962559 stdin:76 stdout:76 stderr:78
[mux  962518] 17:08:18.113668 D mitogen.parent: ssh.{{ inventory_hostname }}{{ local_ssh_domain }}: (unrecognized): ssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known
[mux  962518] 17:08:18.114313 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 78>: empty read, disconnecting
[mux  962518] 17:08:18.114508 D mitogen: SetupProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.114679 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 76>: empty read, disconnecting
[mux  962518] 17:08:18.114808 D mitogen.parent: failing connection ssh.{{ inventory_hostname }}{{ local_ssh_domain }} due to EofError('EOF on stream; last 100 lines received:\nssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known\r')
[mux  962518] 17:08:18.114962 D mitogen.parent: PopenProcess ssh.{{ inventory_hostname }}{{ local_ssh_domain }} pid 962559: exited with return code 255
[mux  962518] 17:08:18.115045 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.115166 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[task 962554] 17:08:18.116058 D ansible_mitogen.process: will use multiplexer 0 (/tmp/mitogen_unix_eq9rjudc.sock) to connect to "aya"
[mux  962518] 17:08:18.117169 D mitogen.parent: creating connection to context 4 using mitogen.ssh
[mux  962518] 17:08:18.118711 D mitogen.parent: command line for Connection(None): ssh -o "LogLevel ERROR" -l "{{ setup_ansible_user_login }}" -o "Compression yes" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 10" -o "BatchMode yes" -o "StrictHostKeyChecking yes" -C -o ControlMaster=auto -o ControlPersist=60s "{{ inventory_hostname }}{{ local_ssh_domain }}" python3.7 -c "'import codecs,os,sys;_=codecs.decode;exec(_(_(\"eNqVkl9PgzAUxd/3KXy7bSSsxegckcRlm87E/QmZEjMJgVG0biukwHB+esswG8wH41t/Pefee6DX1hwrTvWEJwzhltSKGvHoTEEUyxXCZqs8h3liIKJRQvCRba1OUqm04uU6Thmy6yDr4NShUFANzIW/UeMXxLUsGPiy4AJ8EdYlw12YhnsDtLtX0l2qs0+2zDM/WDNV1c5T2Q64aCe77D0WYJ44Tg2G3oF/j1f3BjHoIcGWyZTHYmFelJVlS1PVMLHlUt3C7GU+mk68x97TpD8aDrw7ezr2HLs3mw1tcC2gsP8bB3/Pvn8mSmhGrzwK16gpaE08B7ThWfzGhLkNffHBfHHLdv7K7F4Zl/QaA26pRoXkGUNUg/HDfEoIeRWgAizjUH0lbvUtD5ULEMYJE+rZQQaAdcn8ENEO6XawBl88UZ2ixDr6HA2KAMqdiJKfAf39uXrnE3fxl/t3StpMedggA38DSoPhuQ==\".encode(),\"base64\"),\"zip\"))'"
[mux  962518] 17:08:18.125633 D mitogen.parent: child for Connection(None) started: pid:962560 stdin:76 stdout:76 stderr:78
[mux  962518] 17:08:18.132243 D mitogen.parent: ssh.{{ inventory_hostname }}{{ local_ssh_domain }}: (unrecognized): ssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known
[mux  962518] 17:08:18.132652 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 78>: empty read, disconnecting
[mux  962518] 17:08:18.132771 D mitogen: SetupProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.132907 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 76>: empty read, disconnecting
[mux  962518] 17:08:18.133034 D mitogen.parent: failing connection ssh.{{ inventory_hostname }}{{ local_ssh_domain }} due to EofError('EOF on stream; last 100 lines received:\nssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known\r')
[mux  962518] 17:08:18.133217 D mitogen.parent: PopenProcess ssh.{{ inventory_hostname }}{{ local_ssh_domain }} pid 962560: exited with return code 255
[mux  962518] 17:08:18.133298 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.133419 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[task 962554] 17:08:18.134118 D ansible_mitogen.process: will use multiplexer 0 (/tmp/mitogen_unix_eq9rjudc.sock) to connect to "aya"
[mux  962518] 17:08:18.134955 D mitogen.parent: creating connection to context 5 using mitogen.ssh
[mux  962518] 17:08:18.136656 D mitogen.parent: command line for Connection(None): ssh -o "LogLevel ERROR" -l "{{ setup_ansible_user_login }}" -o "Compression yes" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 10" -o "BatchMode yes" -o "StrictHostKeyChecking yes" -C -o ControlMaster=auto -o ControlPersist=60s "{{ inventory_hostname }}{{ local_ssh_domain }}" python3.6 -c "'import codecs,os,sys;_=codecs.decode;exec(_(_(\"eNqVkl1PgzAUhu/3K7w7bSSsxeg2IonLNj8S9xEyJWYSAqNo3VZIgeH89ZZhNpgXxrs+fd9zzgs9tuZYcaonPGEIt6RW1IhHZwqiWK4QNlvlOcwTAxGNEoKPbGt1kkqlFS/XccqQXQdZB6cOhYJqYC78jRq/IK5lwdCXBRfgi7AuGe7CNNxroL29ku5SnX2yZZ75wZqpqnaeynbARTvZZe+xAPPEcWow9A78e7y6N4hBDwm2TKY8FgvzoqwsW5qqhoktl+oWZi/z++nEe+w/TQb3o6F3a0/HnmP3Z7ORDa4FFPZ/4+Dv23fPRAnN6JVH4Ro1Ba2J54A2PIvfmDC3oS8+mC9u2M5fmb0r45J2MeCWalRInjFENRg/zKeEkFcBKsAyDtVX4tbA8lC5AGGcMKGeHWQAWJfMDxHtkF4Xa/DFE9UpSqyjz9GgCKDciSj5GTDYn6t3PnEXf7l/p6TNlIcNMvA3SxXhug==\".encode(),\"base64\"),\"zip\"))'"
[mux  962518] 17:08:18.144508 D mitogen.parent: child for Connection(None) started: pid:962561 stdin:76 stdout:76 stderr:78
[mux  962518] 17:08:18.152544 D mitogen.parent: ssh.{{ inventory_hostname }}{{ local_ssh_domain }}: (unrecognized): ssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known
[mux  962518] 17:08:18.152916 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 78>: empty read, disconnecting
[mux  962518] 17:08:18.153028 D mitogen: SetupProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.153125 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 76>: empty read, disconnecting
[mux  962518] 17:08:18.153238 D mitogen.parent: failing connection ssh.{{ inventory_hostname }}{{ local_ssh_domain }} due to EofError('EOF on stream; last 100 lines received:\nssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known\r')
[mux  962518] 17:08:18.153374 D mitogen.parent: PopenProcess ssh.{{ inventory_hostname }}{{ local_ssh_domain }} pid 962561: exited with return code 255
[mux  962518] 17:08:18.153446 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.153581 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[task 962554] 17:08:18.154318 D ansible_mitogen.process: will use multiplexer 0 (/tmp/mitogen_unix_eq9rjudc.sock) to connect to "aya"
[mux  962518] 17:08:18.155136 D mitogen.parent: creating connection to context 6 using mitogen.ssh
[mux  962518] 17:08:18.156654 D mitogen.parent: command line for Connection(None): ssh -o "LogLevel ERROR" -l "{{ setup_ansible_user_login }}" -o "Compression yes" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 10" -o "BatchMode yes" -o "StrictHostKeyChecking yes" -C -o ControlMaster=auto -o ControlPersist=60s "{{ inventory_hostname }}{{ local_ssh_domain }}" python3.5 -c "'import codecs,os,sys;_=codecs.decode;exec(_(_(\"eNqVkl9PgzAUxd/3KXy7bSSsxegckcRlm87E/QmZEjMJgVG0biukwHB+esswG8wH41t/Pefee6DX1hwrTvWEJwzhltSKGvHoTEEUyxXCZqs8h3liIKJRQvCRba1OUqm04uU6Thmy6yDr4NShUFANzIW/UeMXxLUsGPiy4AJ8EdYlw12YhnsDtLtX0l2qs0+2zDM/WDNV1c5T2Q64aCe77D0WYJ44Tg2G3oF/j1f3BjHoIcGWyZTHYmFelJVlS1PVMLHlUt3C7GU+mk68x97TpD8aDrw7ezr2HLs3mw1tcC2gsP8bB3/Pvn8mSmhGrzwK16gpaE08B7ThWfzGhLkNffHBfHHLdv7K7F4Zl/QaA26pRoXkGUNUg/HDfEoIeRWgAizjUH0lbvUtD5ULEMYJE+rZQQaAdcn8ENEO6XawBl88UZ2ixDr6HA2KAMqdiJKfAf39uXrnE3fxl/t3StpMedggA38DSoPhuQ==\".encode(),\"base64\"),\"zip\"))'"
[mux  962518] 17:08:18.164045 D mitogen.parent: child for Connection(None) started: pid:962562 stdin:76 stdout:76 stderr:78
[mux  962518] 17:08:18.170634 D mitogen.parent: ssh.{{ inventory_hostname }}{{ local_ssh_domain }}: (unrecognized): ssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known
[mux  962518] 17:08:18.170991 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 78>: empty read, disconnecting
[mux  962518] 17:08:18.171112 D mitogen: SetupProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.171216 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 76>: empty read, disconnecting
[mux  962518] 17:08:18.171335 D mitogen.parent: failing connection ssh.{{ inventory_hostname }}{{ local_ssh_domain }} due to EofError('EOF on stream; last 100 lines received:\nssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known\r')
[mux  962518] 17:08:18.171481 D mitogen.parent: PopenProcess ssh.{{ inventory_hostname }}{{ local_ssh_domain }} pid 962562: exited with return code 255
[mux  962518] 17:08:18.171560 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.171679 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[task 962554] 17:08:18.172425 D ansible_mitogen.process: will use multiplexer 0 (/tmp/mitogen_unix_eq9rjudc.sock) to connect to "aya"
[mux  962518] 17:08:18.173264 D mitogen.parent: creating connection to context 7 using mitogen.ssh
[mux  962518] 17:08:18.174834 D mitogen.parent: command line for Connection(None): ssh -o "LogLevel ERROR" -l "{{ setup_ansible_user_login }}" -o "Compression yes" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 10" -o "BatchMode yes" -o "StrictHostKeyChecking yes" -C -o ControlMaster=auto -o ControlPersist=60s "{{ inventory_hostname }}{{ local_ssh_domain }}" python2.7 -c "'import codecs,os,sys;_=codecs.decode;exec(_(_(\"eNqVkl1PgzAUhu/3K7w7bSSsxeg2IonLNj8S9xEyJWYSAqNo3VZIgeH89ZZhNpgXxrs+fd9zzgs9tuZYcaonPGEIt6RW1IhHZwqiWK4QNlvlOcwTAxGNEoKPbGt1kkqlFS/XccqQXQdZB6cOhYJqYC78jRq/IK5lwdCXBRfgi7AuGe7CNNxroL29ku5SnX2yZZ75wZqpqnaeynbARTvZZe+xAPPEcWow9A78e7y6N4hBDwm2TKY8FgvzoqwsW5qqhoktl+oWZi/z++nEe+w/TQb3o6F3a0/HnmP3Z7ORDa4FFPZ/4+Dv23fPRAnN6JVH4Ro1Ba2J54A2PIvfmDC3oS8+mC9u2M5fmb0r45J2MeCWalRInjFENRg/zKeEkFcBKsAyDtVX4tbA8lC5AGGcMKGeHWQAWJfMDxHtkF4Xa/DFE9UpSqyjz9GgCKDciSj5GTDYn6t3PnEXf7l/p6TNlIcNMvA3SxXhug==\".encode(),\"base64\"),\"zip\"))'"
[mux  962518] 17:08:18.183577 D mitogen.parent: child for Connection(None) started: pid:962563 stdin:76 stdout:76 stderr:78
[mux  962518] 17:08:18.189887 D mitogen.parent: ssh.{{ inventory_hostname }}{{ local_ssh_domain }}: (unrecognized): ssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known
[mux  962518] 17:08:18.190163 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 78>: empty read, disconnecting
[mux  962518] 17:08:18.190266 D mitogen: SetupProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.190422 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 76>: empty read, disconnecting
[mux  962518] 17:08:18.190505 D mitogen.parent: failing connection ssh.{{ inventory_hostname }}{{ local_ssh_domain }} due to EofError('EOF on stream; last 100 lines received:\nssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known\r')
[mux  962518] 17:08:18.190621 D mitogen.parent: PopenProcess ssh.{{ inventory_hostname }}{{ local_ssh_domain }} pid 962563: exited with return code 255
[mux  962518] 17:08:18.190683 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.190775 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[task 962554] 17:08:18.191473 D ansible_mitogen.process: will use multiplexer 0 (/tmp/mitogen_unix_eq9rjudc.sock) to connect to "aya"
[mux  962518] 17:08:18.192348 D mitogen.parent: creating connection to context 8 using mitogen.ssh
[mux  962518] 17:08:18.193963 D mitogen.parent: command line for Connection(None): ssh -o "LogLevel ERROR" -l "{{ setup_ansible_user_login }}" -o "Compression yes" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 10" -o "BatchMode yes" -o "StrictHostKeyChecking yes" -C -o ControlMaster=auto -o ControlPersist=60s "{{ inventory_hostname }}{{ local_ssh_domain }}" python2.6 -c "'import codecs,os,sys;_=codecs.decode;exec(_(_(\"eNqVkl1PgzAUhu/3K7w7bSSsxeg2IonLNj8S9xEyJWYSAqNo3VZIgeH89ZZhNpgXxrs+fd9zzgs9tuZYcaonPGEIt6RW1IhHZwqiWK4QNlvlOcwTAxGNEoKPbGt1kkqlFS/XccqQXQdZB6cOhYJqYC78jRq/IK5lwdCXBRfgi7AuGe7CNNxroL29ku5SnX2yZZ75wZqpqnaeynbARTvZZe+xAPPEcWow9A78e7y6N4hBDwm2TKY8FgvzoqwsW5qqhoktl+oWZi/z++nEe+w/TQb3o6F3a0/HnmP3Z7ORDa4FFPZ/4+Dv23fPRAnN6JVH4Ro1Ba2J54A2PIvfmDC3oS8+mC9u2M5fmb0r45J2MeCWalRInjFENRg/zKeEkFcBKsAyDtVX4tbA8lC5AGGcMKGeHWQAWJfMDxHtkF4Xa/DFE9UpSqyjz9GgCKDciSj5GTDYn6t3PnEXf7l/p6TNlIcNMvA3SxXhug==\".encode(),\"base64\"),\"zip\"))'"
[mux  962518] 17:08:18.201722 D mitogen.parent: child for Connection(None) started: pid:962564 stdin:76 stdout:76 stderr:78
[mux  962518] 17:08:18.208247 D mitogen.parent: ssh.{{ inventory_hostname }}{{ local_ssh_domain }}: (unrecognized): ssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known
[mux  962518] 17:08:18.208602 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 78>: empty read, disconnecting
[mux  962518] 17:08:18.208697 D mitogen: SetupProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.208798 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 76>: empty read, disconnecting
[mux  962518] 17:08:18.208912 D mitogen.parent: failing connection ssh.{{ inventory_hostname }}{{ local_ssh_domain }} due to EofError('EOF on stream; last 100 lines received:\nssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known\r')
[mux  962518] 17:08:18.209036 D mitogen.parent: PopenProcess ssh.{{ inventory_hostname }}{{ local_ssh_domain }} pid 962564: exited with return code 255
[mux  962518] 17:08:18.209107 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.209228 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[task 962554] 17:08:18.210044 D ansible_mitogen.process: will use multiplexer 0 (/tmp/mitogen_unix_eq9rjudc.sock) to connect to "aya"
[mux  962518] 17:08:18.211033 D mitogen.parent: creating connection to context 9 using mitogen.ssh
[mux  962518] 17:08:18.213326 D mitogen.parent: command line for Connection(None): ssh -o "LogLevel ERROR" -l "{{ setup_ansible_user_login }}" -o "Compression yes" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 10" -o "BatchMode yes" -o "StrictHostKeyChecking yes" -C -o ControlMaster=auto -o ControlPersist=60s "{{ inventory_hostname }}{{ local_ssh_domain }}" /usr/libexec/platform-python -c "'import codecs,os,sys;_=codecs.decode;exec(_(_(\"eNqVkl1PgzAUhu/3K7w7bSSsxeg2IonLNj8S9xEyJWYSAqNo3VZIgeH89ZZhNpgXxrs+fd9zzgs9tuZYcaonPGEIt6RW1IhHZwqiWK4QNlvlOcwTAxGNEoKPbGt1kkqlFS/XccqQXQdZB6cOhYJqYC78jRq/IK5lwdCXBRfgi7AuGe7CNNxroL29ku5SnX2yZZ75wZqpqnaeynbARTvZZe+xAPPEcWow9A78e7y6N4hBDwm2TKY8FgvzoqwsW5qqhoktl+oWZi/z++nEe+w/TQb3o6F3a0/HnmP3Z7ORDa4FFPZ/4+Dv23fPRAnN6JVH4Ro1Ba2J54A2PIvfmDC3oS8+mC9u2M5fmb0r45J2MeCWalRInjFENRg/zKeEkFcBKsAyDtVX4tbA8lC5AGGcMKGeHWQAWJfMDxHtkF4Xa/DFE9UpSqyjz9GgCKDciSj5GTDYn6t3PnEXf7l/p6TNlIcNMvA3SxXhug==\".encode(),\"base64\"),\"zip\"))'"
[mux  962518] 17:08:18.221341 D mitogen.parent: child for Connection(None) started: pid:962565 stdin:76 stdout:76 stderr:78
[mux  962518] 17:08:18.227625 D mitogen.parent: ssh.{{ inventory_hostname }}{{ local_ssh_domain }}: (unrecognized): ssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known
[mux  962518] 17:08:18.228024 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 78>: empty read, disconnecting
[mux  962518] 17:08:18.228127 D mitogen: SetupProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.228226 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 76>: empty read, disconnecting
[mux  962518] 17:08:18.228342 D mitogen.parent: failing connection ssh.{{ inventory_hostname }}{{ local_ssh_domain }} due to EofError('EOF on stream; last 100 lines received:\nssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known\r')
[mux  962518] 17:08:18.228490 D mitogen.parent: PopenProcess ssh.{{ inventory_hostname }}{{ local_ssh_domain }} pid 962565: exited with return code 255
[mux  962518] 17:08:18.228547 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.228649 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[task 962554] 17:08:18.229368 D ansible_mitogen.process: will use multiplexer 0 (/tmp/mitogen_unix_eq9rjudc.sock) to connect to "aya"
[mux  962518] 17:08:18.230091 D mitogen.parent: creating connection to context 10 using mitogen.ssh
[mux  962518] 17:08:18.231583 D mitogen.parent: command line for Connection(None): ssh -o "LogLevel ERROR" -l "{{ setup_ansible_user_login }}" -o "Compression yes" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 10" -o "BatchMode yes" -o "StrictHostKeyChecking yes" -C -o ControlMaster=auto -o ControlPersist=60s "{{ inventory_hostname }}{{ local_ssh_domain }}" /usr/bin/python3 -c "'import codecs,os,sys;_=codecs.decode;exec(_(_(\"eNqVkl1PgzAUhu/5Fd6dNhLW4scckcRlmx+J+wiZLmYSAqNo3VZIgeH89ZZhNpgXxrs+fd9zzgs9jj6z49RIeMIQ1qRe1IhHJwqiWC4RtrTyHOaJiYhOCcEHdvQ6SaXSiherOGXIqYOsw6wOhYJqYC78tRo/J65tQ9+XBRfgi7Aume7cMt1roJ2dkm5Tg32yRZ75wYqpqlaeylbARSvZZu+xAOvIcWwwjTb8e7y6N4lJ9wk2TKY8FnPrrKwsW1qqhokNl+oWJi/T+/HIe+w+jXr3g75364yH3szpTiYDB1wbKOz+xt7fde6eiRKa0SuPwhVqCnoTTwGteRa/MWFtQl98MF/csK2/tDqX5gW9woA11aiQPGOI6jB8mI4JIa8CVIBFHKqvxFrP9lC5AGGcMKGeHWQA2JDMDxFtk8451uGLJ6pTlNgH30yHIoByJ6LkZ0Bvd67e+chd/OX+nZI2U+43yMTfSM3htg==\".encode(),\"base64\"),\"zip\"))'"
[mux  962518] 17:08:18.238789 D mitogen.parent: child for Connection(None) started: pid:962566 stdin:76 stdout:76 stderr:78
[mux  962518] 17:08:18.246001 D mitogen.parent: ssh.{{ inventory_hostname }}{{ local_ssh_domain }}: (unrecognized): ssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known
[mux  962518] 17:08:18.246534 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 78>: empty read, disconnecting
[mux  962518] 17:08:18.246699 D mitogen: SetupProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.246793 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 76>: empty read, disconnecting
[mux  962518] 17:08:18.246934 D mitogen.parent: failing connection ssh.{{ inventory_hostname }}{{ local_ssh_domain }} due to EofError('EOF on stream; last 100 lines received:\nssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known\r')
[mux  962518] 17:08:18.247050 D mitogen.parent: PopenProcess ssh.{{ inventory_hostname }}{{ local_ssh_domain }} pid 962566: exited with return code 255
[mux  962518] 17:08:18.247106 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.247211 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[task 962554] 17:08:18.247957 D ansible_mitogen.process: will use multiplexer 0 (/tmp/mitogen_unix_eq9rjudc.sock) to connect to "aya"
[mux  962518] 17:08:18.249550 D mitogen.parent: creating connection to context 11 using mitogen.ssh
[mux  962518] 17:08:18.250983 D mitogen.parent: command line for Connection(None): ssh -o "LogLevel ERROR" -l "{{ setup_ansible_user_login }}" -o "Compression yes" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 10" -o "BatchMode yes" -o "StrictHostKeyChecking yes" -C -o ControlMaster=auto -o ControlPersist=60s "{{ inventory_hostname }}{{ local_ssh_domain }}" python -c "'import codecs,os,sys;_=codecs.decode;exec(_(_(\"eNqVkl9PgzAUxd/5FL7dNhLWYnSOSOKyTWfi/oRMiZmEwChatxVSYDg/vWUzG8wH41t/Pefee6DX0V07yYyUpwxhTepljXh8piBO5BJhS6vOUZGaiOiUEHxkR6+TVCrd82KVZAw5dZB1cOtQKtgPLESwVuPnxLNt6Aey5AICEdUl05tbpncDtLNTsm1msE+2KPIgXDFV1Soy2Qq5aKXb/D0RYJ04Tg2m0YZ/j1f3JjHpIcGGyYwnYm5dVJVVS0vVMLHhUt3C9GU2nIz9x+7TuDcc9P07ZzLyXac7nQ4c8GygsPsbB3/XuX8mSmhG33sUrlBT0Jt4DmjN8+SNCWsTBeKDBeKWbYOl1bkyL+k1BqypRqXkOUNUh9HDbEIIeRWgAiySSH0l1nq2j6oFiJKUCfXsIEPAhmRBhGibdK6wDl88VZ3i1D76XB3KEKqdiNOfAb3def/OJ+7yL/fvlLSZ8rBBJv4GSfHhuA==\".encode(),\"base64\"),\"zip\"))'"
[mux  962518] 17:08:18.258601 D mitogen.parent: child for Connection(None) started: pid:962567 stdin:76 stdout:76 stderr:78
[mux  962518] 17:08:18.265579 D mitogen.parent: ssh.{{ inventory_hostname }}{{ local_ssh_domain }}: (unrecognized): ssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known
[mux  962518] 17:08:18.266096 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 78>: empty read, disconnecting
[mux  962518] 17:08:18.266243 D mitogen: SetupProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.266358 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 76>: empty read, disconnecting
[mux  962518] 17:08:18.266459 D mitogen.parent: failing connection ssh.{{ inventory_hostname }}{{ local_ssh_domain }} due to EofError('EOF on stream; last 100 lines received:\nssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known\r')
[mux  962518] 17:08:18.266620 D mitogen.parent: PopenProcess ssh.{{ inventory_hostname }}{{ local_ssh_domain }} pid 962567: exited with return code 255
[mux  962518] 17:08:18.266701 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.266797 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[WARNING]: Unhandled error in Python interpreter discovery for host aya: EOF on stream; last 100 lines received: ssh: Could not resolve
hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known
[task 962554] 17:08:18.269111 D ansible_mitogen.process: will use multiplexer 0 (/tmp/mitogen_unix_eq9rjudc.sock) to connect to "aya"
[mux  962518] 17:08:18.270160 D mitogen.parent: creating connection to context 12 using mitogen.ssh
[mux  962518] 17:08:18.271630 D mitogen.parent: command line for Connection(None): ssh -o "LogLevel ERROR" -l "{{ setup_ansible_user_login }}" -o "Compression yes" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 10" -o "BatchMode yes" -o "StrictHostKeyChecking yes" -C -o ControlMaster=auto -o ControlPersist=60s "{{ inventory_hostname }}{{ local_ssh_domain }}" /usr/bin/python -c "'import codecs,os,sys;_=codecs.decode;exec(_(_(\"eNqVkl9PgzAUxd/3KXy7bSSsxegckcRlm87E/QmZEjMJgVG0biukwHB+esswG8wH41t/Pefee6DX1hwrTvWEJwzhltSKGvHoTEEUyxXCZqs8h3liIKJRQvCRba1OUqm04uU6Thmy6yDr4NShUFANzIW/UeMXxLUsGPiy4AJ8EdYlw12YhnsDtLtX0l2qs0+2zDM/WDNV1c5T2Q64aCe77D0WYJ44Tg2G3oF/j1f3BjHoIcGWyZTHYmFelJVlS1PVMLHlUt3C7GU+mk68x97TpD8aDrw7ezr2HLs3mw1tcC2gsP8bB3/Pvn8mSmhGrzwK16gpaE08B7ThWfzGhLkNffHBfHHLdv7K7F4Zl/QaA26pRoXkGUNUg/HDfEoIeRWgAizjUH0lbvUtD5ULEMYJE+rZQQaAdcn8ENEO6XawBl88UZ2ixDr6HA2KAMqdiJKfAf39uXrnE3fxl/t3StpMedggA38DSoPhuQ==\".encode(),\"base64\"),\"zip\"))'"
[mux  962518] 17:08:18.279739 D mitogen.parent: child for Connection(None) started: pid:962568 stdin:76 stdout:76 stderr:78
[mux  962518] 17:08:18.286053 D mitogen.parent: ssh.{{ inventory_hostname }}{{ local_ssh_domain }}: (unrecognized): ssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known
[mux  962518] 17:08:18.286450 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 78>: empty read, disconnecting
[mux  962518] 17:08:18.286561 D mitogen: SetupProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.286684 D mitogen: <Side of ssh.{{ inventory_hostname }}{{ local_ssh_domain }} fd 76>: empty read, disconnecting
[mux  962518] 17:08:18.286798 D mitogen.parent: failing connection ssh.{{ inventory_hostname }}{{ local_ssh_domain }} due to EofError('EOF on stream; last 100 lines received:\nssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known\r')
[mux  962518] 17:08:18.286923 D mitogen.parent: PopenProcess ssh.{{ inventory_hostname }}{{ local_ssh_domain }} pid 962568: exited with return code 255
[mux  962518] 17:08:18.286992 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[mux  962518] 17:08:18.287117 D mitogen: BootstrapProtocol(ssh.{{ inventory_hostname }}{{ local_ssh_domain }}): disconnecting
[task 962554] 17:08:18.287644 D ansible_mitogen.mixins: _remove_tmp_path(None)
[task 962554] 17:08:18.287937 D mitogen: MitogenProtocol(unix_listener.962518): disconnecting
[mux  962518] 17:08:18.288448 D mitogen: <Side of unix_client.962554 fd 75>: empty read, disconnecting
[task 962554] 17:08:18.288161 D mitogen: Waker(fd=11/12): disconnecting
[task 962554] 17:08:18.288362 D mitogen: Router(Broker(9e50)): stats: 0 module requests in 0 ms, 0 sent (0 ms minify time), 0 negative responses. Sent 0.0 kb total, 0.0 kb avg.
[mux  962518] 17:08:18.288632 D mitogen: MitogenProtocol(unix_client.962554): disconnecting
fatal: [aya]: UNREACHABLE! => {
    "changed": false,
    "msg": "EOF on stream; last 100 lines received:\nssh: Could not resolve hostname {{ inventory_hostname }}{{ local_ssh_domain }}: Name or service not known\r",
    "unreachable": true
}
...ignoring

TASK [debug] *****************************************************************************************************************************
task path: /home/vdanjean/travail/perso/Claire/NGS/gitolite/vdanjean-chu-ansible/bug/test.yml:16
[task 962569] 17:08:18.299500 D ansible_mitogen.affinity: CPU mask for WorkerProcess: 0x000004
[task 962569] 17:08:18.309791 D ansible_mitogen.mixins: _remove_tmp_path(None)
ok: [aya] => {
    "res": {
        "changed": false,
        "msg": "EOF on stream; last 100 lines received:\nssh: Could not resolve hostname aya: Name or service not known",
        "unreachable": true
    }
}

PLAY RECAP *******************************************************************************************************************************
aya                        : ok=3    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=1   

[mux  962518] 17:08:18.323940 D mitogen: Waker(fd=6/8): disconnecting
[mux  962518] 17:08:18.324484 D mitogen: Router(Broker(63d0)): stats: 0 module requests in 0 ms, 0 sent (0 ms minify time), 0 negative responses. Sent 0.0 kb total, 0.0 kb avg.
[mux  962518] 17:08:18.324622 D mitogen.service: thread mitogen.Pool.1210.11 exiting gracefully
[mux  962518] 17:08:18.324898 D mitogen.service: thread mitogen.Pool.1210.12 exiting gracefully
[mux  962518] 17:08:18.325046 D mitogen.service: thread mitogen.Pool.1210.13 exiting gracefully
[mux  962518] 17:08:18.325221 D mitogen.service: thread mitogen.Pool.1210.14 exiting gracefully
[mux  962518] 17:08:18.325470 D mitogen.service: thread mitogen.Pool.1210.15 exiting gracefully
[mux  962518] 17:08:18.325656 D mitogen.service: thread mitogen.Pool.1210.16 exiting gracefully
[mux  962518] 17:08:18.325819 D mitogen.service: thread mitogen.Pool.1210.17 exiting gracefully
[mux  962518] 17:08:18.326015 D mitogen.service: thread mitogen.Pool.1210.18 exiting gracefully
[mux  962518] 17:08:18.326176 D mitogen.service: thread mitogen.Pool.1210.19 exiting gracefully
[mux  962518] 17:08:18.326327 D mitogen.service: thread mitogen.Pool.1210.20 exiting gracefully
[mux  962518] 17:08:18.326462 D mitogen.service: thread mitogen.Pool.1210.21 exiting gracefully
[mux  962518] 17:08:18.326593 D mitogen.service: thread mitogen.Pool.1210.22 exiting gracefully
[mux  962518] 17:08:18.326725 D mitogen.service: thread mitogen.Pool.1210.23 exiting gracefully
[mux  962518] 17:08:18.326863 D mitogen.service: thread mitogen.Pool.1210.24 exiting gracefully
[mux  962518] 17:08:18.327005 D mitogen.service: thread mitogen.Pool.1210.25 exiting gracefully
[mux  962518] 17:08:18.327149 D mitogen.service: thread mitogen.Pool.1210.26 exiting gracefully
[mux  962518] 17:08:18.327291 D mitogen.service: thread mitogen.Pool.1210.27 exiting gracefully
[mux  962518] 17:08:18.327420 D mitogen.service: thread mitogen.Pool.1210.28 exiting gracefully
[mux  962518] 17:08:18.327543 D mitogen.service: thread mitogen.Pool.1210.29 exiting gracefully
[mux  962518] 17:08:18.327674 D mitogen.service: thread mitogen.Pool.1210.30 exiting gracefully
[mux  962518] 17:08:18.327800 D mitogen.service: thread mitogen.Pool.1210.31 exiting gracefully
[mux  962518] 17:08:18.327947 D mitogen.service: thread mitogen.Pool.1210.0 exiting gracefully
[mux  962518] 17:08:18.328101 D mitogen.service: thread mitogen.Pool.1210.1 exiting gracefully
[mux  962518] 17:08:18.328284 D mitogen.service: thread mitogen.Pool.1210.2 exiting gracefully
[mux  962518] 17:08:18.328467 D mitogen.service: thread mitogen.Pool.1210.3 exiting gracefully
[mux  962518] 17:08:18.328631 D mitogen.service: thread mitogen.Pool.1210.4 exiting gracefully
[mux  962518] 17:08:18.328776 D mitogen.service: thread mitogen.Pool.1210.5 exiting gracefully
[mux  962518] 17:08:18.328939 D mitogen.service: thread mitogen.Pool.1210.6 exiting gracefully
[mux  962518] 17:08:18.329091 D mitogen.service: thread mitogen.Pool.1210.7 exiting gracefully
[mux  962518] 17:08:18.329361 D mitogen.service: thread mitogen.Pool.1210.8 exiting gracefully
[mux  962518] 17:08:18.329512 D mitogen.service: thread mitogen.Pool.1210.9 exiting gracefully
[mux  962518] 17:08:18.329660 D mitogen.service: thread mitogen.Pool.1210.10 exiting gracefully
[mux  962518] 17:08:18.329860 D mitogen.service: FileService().on_shutdown()
[top  962514] 17:08:18.334317 D ansible_mitogen.process: multiplexer 0 PID 962518 exited with return code 0

The log shows that ansible_user and ansible_ssh_host are not expended with mitogen. Adding at the start of test.yml the too line that calls set_fact on the variables used by mitogen workaround the problem:

$ cat test.yml 
---

 - name: tests ssh
   hosts: all
   gather_facts: false
   tasks:
     - block:
         - set_fact:
             foo: bar
             ansible_ssh_host: "{{ ansible_ssh_host }}"
             ansible_user: "{{ ansible_user }}"
         - command: hostname
           register: res
           ignore_unreachable: true
       always:
         - debug: var=res

vdanjean@eyak:~/travail/perso/Claire/NGS/gitolite/vdanjean-chu-ansible/bug (master *%)$ ansible-playbook -l aya test.yml 

PLAY [tests ssh] *************************************************************************************************************************

TASK [set_fact] **************************************************************************************************************************
ok: [aya]

TASK [command] ***************************************************************************************************************************
changed: [aya]

TASK [debug] *****************************************************************************************************************************
ok: [aya] => {
    "res": {
        "ansible_facts": {
            "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "cmd": [
            "hostname"
        ],
        "delta": "0:00:00.002604",
        "end": "2023-09-10 17:12:06.823980",
        "failed": false,
        "msg": "",
        "rc": 0,
        "start": "2023-09-10 17:12:06.821376",
        "stderr": "",
        "stderr_lines": [],
        "stdout": "aya",
        "stdout_lines": [
            "aya"
        ]
    }
}

PLAY RECAP *******************************************************************************************************************************
aya                        : ok=3    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Regards, Vincent

dr-yd commented 1 month ago

Small addendum, we have a bootstrap playbook like this:

- vars:
    ansible_user: "{{ _bootstrap_user }}"
  tasks:
    - [ ... provision SSH CA trust and Ansible user ]
    - ping:
         data: "Connection test"
       vars:
         ansible_user: ansible

This of course has the same behavior as mentioned in the OP, but even when hardcoding the _bootstrap_user, the last task fails:

TASK [Test SSH certificate connection]
Thursday 01 August 2024  08:39:30 +0000 (0:00:00.155)       0:00:10.334 ******* 
fatal: [manager1.foo.org]: UNREACHABLE! => changed=false 
  msg: SSH authentication is incorrect
  unreachable: true

This does work with native Ansible, but it seems precedence is evaluated incorrectly here:

command line for Connection(None): ssh -o "LogLevel ERROR" -l debian [...]

Mitogen 0.3.8, Ansible 2.16.9 / 9.8.0.