I have a simple job, that connects to k8s. The openshift module is installed to /var/lib/awx/venv/ansible/
When running the playbook, it fails, being unable to find the openshift module. I had read a couple github issues, relating to this but cant seem to resolve my problem.
[root@awx ~]# source /var/lib/awx/venv/ansible/bin/activate
(ansible) [root@awx ~]# python
Python 2.7.5 (default, Jun 20 2019, 20:27:34)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
Not trying to be annoying but rather complete, did you set the Ansible Environment value in the dropdown on the Job Template before running the job? It could be that the default Ansible Environment was set to another venv as part of your Organization config.
Also, did you install the openshift module in the same location on both the web and task container?
Are you running this task locally on AWX or on another server? If the server that actually runs the task doesn’t have the openshift module installed locally I think you’ll get an error message that looks like that.
And finally, what steps did you take to install openshift in the first place? That’ll help to replicate the problem.
The venv is set correctly in awx, I can see it in the UI.
Openshift is there.
Task is targeted to hosts: localhost
During image build, venv is activated, pip modules ran, unask set per the docs.
It works in every situation until we target localhost. You can see from the previous debug, it’s using the incorrect python path, despite is being set to the venv.