Python compatibility between controller and managed nodes

23 views
Skip to first unread message

Gaétan QUENTIN@Work

unread,
Mar 16, 2022, 11:04:27 AM3/16/22
to Ansible Project
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


--
-----------------
Gaétan

Only doctor Who can reboot the universe.

Felix Fontein

unread,
Mar 16, 2022, 1:18:03 PM3/16/22
to ansible...@googlegroups.com
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


Gaétan QUENTIN@Work

unread,
Mar 16, 2022, 2:13:10 PM3/16/22
to ansible...@googlegroups.com
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

Brian Coca

unread,
Mar 21, 2022, 4:56:47 PM3/21/22
to Ansible Project
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.


--
----------
Brian Coca

Reply all
Reply to author
Forward
0 new messages