Python Script is not running on the specified Ansible Automation Platform Execution Environment

Viewed 24

I have an Ansible Playbook which has a task to run a python script. The code for the task is as follows:

tasks:

  • name: run a python script command: python3 /home/pythonfiles/endec.py {{ operation }} {{ str }} {{ passwd }} register: result

The python script imports a package called "Cryptocode" which I have installed on an Execution Environment Container image that is stored on quay.io and is accessed using the Automation Platform.

When I run the playbook with the Execution Environment that has the python package installed (I checked using podman run imagename pip3 list command which does list the cryptocode package I've mentioned), an error is thrown saying that "import cryptocode","ModuleNotFoundError: No module named 'cryptocode'"

However, when I pip3 install cryptocode on the execution node that runs the playbook no errors are shown.

Is there a reason why the python script is not being run inside the Execution Environment (Container Image)? Could someone please help me fix this issue? Thank you in advance!

0 Answers
Related