Python compatibility between controller and managed nodes

Hi,

A question about python compatibility between controller and managed node.

Do an ansible controller 2.9.XX with python 2.7.X can manage nodes where python 3.8 is installed?

The answer is not clear here: https://docs.ansible.com/ansible/latest/reference_appendices/python_3_support.html

Regards

Hi,

A question about python compatibility between controller and
managed node.

Do an ansible controller 2.9.XX with python 2.7.X can manage nodes
where python 3.8 is installed?

yes. There is no relation between the Python versions on controller and
target (except that both have to be supported by Ansible).

Best,
Felix

thank you for this response.

in my comprehension, ansible controller push some python code onto the target and this code is executed on the target.

does that mean that a 3.8 target recognize 2.7 code (we all know there is a compatibility rupture between 2.7 and 3.X) and can execute 2.7 code without problem?

is there an official documentation about that ?

Regards,

Gaétan

the code pushed is from modules and module_utils, which are coded to
be compatible with the widest range of python versions.
You could also write modules in other languages (and people have in
perl/ruby/bash/golang/etc) and use ansible to execute them, the code
on the controller really does not have to match with the code
executing on remotes.