mitogen icon indicating copy to clipboard operation
mitogen copied to clipboard

ansible_mitogen: rediscover python on local connection

Open qezz opened this issue 2 years ago • 1 comments

Fixes the python discovery on delegate_to: localhost

Reading some opened issues it seems like there's an issue when delegating to other hosts as well. But I cannot check this behavior personally.

This is the first attempt to fix it, and I think it's not very effective to rediscover python on every local connection. I think it's possible to make it rediscover conditionally, i.e. when switching from one host to another.

This has been tested against v0.3.3. The version on master doesn't work for me.

Related:

  • https://github.com/mitogen-hq/mitogen/issues/955

qezz avatar Apr 30 '23 18:04 qezz

I get this issue when delegating in general e.g.:

hosts: suse-host
  tasks:
    - name: delegated with wrong python interpreter
      command: echo success
      delegate_to: debian-host

Will end up with /usr/bin/python3.6: No such file or directory and indeed debian doesn't really carry python 3.6 anymore, but ansible decided to pass the discovered interpreted onto it instead of discovering the correct one.

This looks the same as https://github.com/ansible/ansible/issues/61002, maybe mitogen overrides a key part of the fix?

mistotebe avatar May 15 '24 10:05 mistotebe