I have a very basic playbook that simply runs a script using the shell module
on the target remote host.
In the output it however fails stating python interpreter not found
.
Installing python on each target is not the solution I can pursue.
Is it possible to use my Ansible automation to run the playbook and execute the script using shell module without having python dependency?
By default Ansible modules require python to be present in the target machines, since they are all written in python.
Control Machine Requirements Currently Ansible can be run from any machine with Python 2 (version 2.7) or Python 3 (versions 3.5 and higher) installed. Windows isn't supported for the control machine. This includes Red Hat, Debian, CentOS, macOS, any of the BSDs, and so on.
Most of the Ansible modules in Ansible Core are written for a combination of Linux/Unix machines and arbitrary web services. These modules are written in Python and most of them do not work on Windows.
Any ansible operation requires python on the target node except the raw
and script
modules.
Please note that these two modules are primarily meant to install ansible requirements (i.e. Python and its mandatory modules) on targets where they are missing.
In other words, Python is definitely a requirement to run ansible following all best practices (e.g. using modules when they exists, creating idempotent tasks...). If installing Python on your targets is not an option, don't use ansible, choose an other tool.
References:
raw
modulescript
moduleIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With