ansible / awx-ee

An Ansible execution environment for AWX project
https://quay.io/ansible/awx-ee
Other
132 stars 158 forks source link

AWX - Unable to use my AWX-EE Custom #103

Closed t-benedet closed 2 years ago

t-benedet commented 2 years ago

Hi guys,

I'm a beginner with ansible and I try to deploy a classic virtual machine debian with an ansible playbook from AWX to my ESXI standalone on my Raspberry 4.

But when I run the template, I've this error :

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError:
 No module named 'pyVim' fatal: [ESXI]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/libexec/platform-python"}, "changed": false, "msg": "Failed to import the required Python library (PyVmomi) on automation-job-144-hcsd8's Python /usr/libexec/platform-python. 
 Please read the module documentation and install it in the appropriate location.
  If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"}`

So I decide to create my own awx-ee by following this tutorial : https://www.linkedin.com/pulse/creating-custom-ee-awx-phil-griffiths/

And by adding pyVmomi and pyVim in my requirements.txt then I build and push to my quay repository. I change my execution environment for my project and my template :

image

image

image

But now I've this error :

Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/tasks/jobs.py", line 552, in run
    res = receptor_job.run()
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/tasks/receptor.py", line 279, in run
    res = self._run_internal(receptor_ctl)
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/tasks/receptor.py", line 309, in _run_internal
    result = receptor_ctl.submit_work(worktype=self.work_type, payload=sockout.makefile('rb'), params=self.receptor_params, signwork=self.sign_work, **_kw)
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/tasks/receptor.py", line 423, in receptor_params
    spec_yaml = yaml.dump(self.pod_definition, explicit_start=True)
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/tasks/receptor.py", line 471, in pod_definition
    default_pod_spec = get_default_pod_spec()
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/utils/execution_environments.py", line 27, in get_default_pod_spec
    raise RuntimeError("Unable to find an execution environment.")
RuntimeError: Unable to find an execution environment.

Aand I really don't know how to fix it.

There is someone to help me ?

Thanks a lot !

AlanCoding commented 2 years ago

https://github.com/ansible/awx/blob/faba64890e621ff9b3970c681dc4cb4abebf1c64/awx/main/utils/execution_environments.py#L27

You don't have a default execution environment. You probably deleted it or renamed it. There is a setting that defines the name for the global EE, and these methods look for one with that name.

t-benedet commented 2 years ago

Hi,

Thanks for the answer.

So I have to do the same things but I have to rename my custom image with this same name as the awx-ee original and that's it ?

AlanCoding commented 2 years ago

probably should work. You can associate your custom EE with the job template as well.