Automated custom python deployment

I need to run ansible in target hosts with a custom python distribution. Currently I uploaded this python distribution manually and configured ansible_python_interpreter (Interpreter Discovery β€” Ansible Community Documentation) to that specific path.

However, I wonder is there a way to automate this upload process using ansible?

Python distribution needs to be uploaded similar to a module code in a temp directory and then used to run other modules.

Hi and welcome to the forum!
You can use the ansible.builtin.raw module to install Python on a system without Python installed by default.

3 Likes