[AWX][Kubernetes] Cannot install new python modules nor create a new virtualenv.

Hi all,

I am working in the deployment of AWX using Kubernetes. Everything seems to works and I can create projects, associate playbooks, even run those playbooks on my servers.

One of my playbooks is using the f5 big ip module to enable and disable nodes on BigIP. The problem that I have is that there are some python modules missing, so I can’t use the BigIP module.

{ "_ansible_parsed": true, "deprecations": [], "exception": " File \"/tmp/ansible_o9NWnB/ansible_module_bigip_pool_member.py\", line 199, in <module>\n from library.module_utils.network.f5.common import f5_argument_spec\n", "changed": false, "_ansible_no_log": false, "_ansible_delegated_vars": { "ansible_delegated_host": "localhost", "ansible_host": "localhost" }, "_ansible_item_result": true, "item": { "name": "server-patching-poc.domain.internal", "port": "22" }, "invocation": { "module_args": { "session_state": "disabled", "ratio": null, "description": null, "transport": "rest", "monitor_state": "disabled", "partition": "Common", "rate_limit": null, "connection_limit": null, "server": "bigip.domain.internal", "state": "present", "preserve_node": false, "user": "myuser", "server_port": 443, "provider": { "ssh_keyfile": null, "server_port": 443, "server": "bigip.domain.internal", "user": "myuser", "timeout": 10, "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "validate_certs": false, "transport": "rest" }, "host": "server-patching-poc-2..domain.internal`",
“priority_group”: null,
“password”: “VALUE_SPECIFIED_IN_NO_LOG_PARAMETER”,
“validate_certs”: false,
“port”: 22,
“pool”: “server-patching-poc.domain.internal”
}
},
“_ansible_ignore_errors”: null,
“msg”: “the python bigsuds module is required”
}

`

I tried to install the module but I am getting a permission denied, I also tried to perform a 'su' to root but it seems that there is no root user in the kubernetes installation. I even tried to create a new virtualenv with the awx user, but I can't move it under /var/lib/awx due lack of permissions.

How can I solve this issue?

Thanks in advance.

Cheers,
nrk

nrk,

To add additional Python dependencies to awx installs, you must a custom image that installs your additional dependencies. Documentation on this process can be found at:

https://github.com/ansible/awx/blob/devel/docs/custom_virtualenvs.md

and:

https://github.com/ansible/awx/blob/devel/INSTALL.md#official-vs-building-images

Thanks!

In that case I will build my own images on the top of awx_web and awx_task.

Cheers,
nrk

Hello Ryan,

I am trying to build my own image but I am still getting errors creating the venv.

This is my docker Dockerfile.

`
FROM ${docker.image.from}

LABEL BIGSUDS=“${bigsuds.version}”

RUN && virtualenv --system-site-packages /var/lib/awx/venv/awx-extended-venv
&& source /var/lib/awx/venv/awx-extended-venv/activate \

`

The path for virtual envs is owned by root and I can’t write as awx in that path. The valeu for ${docker.image.from} is <docker.image.from>ansible/awx_task</docker.image.from>

And this is the error that I am getting


[INFO] F8: —> Running in 802fcbc039e9
[INFO] F8: [91msudo: unknown uid 1000: who are you?

[INFO] F8: Removing intermediate container 802fcbc039e9
[ERROR] F8: I/O Error executing build for image [dev/docker-awx-task-venv-image:20180427094228]:io.fabric8.maven.docker.access.DockerAccessException: Unable to build image [dev/docker-awx-task-venv-image:20180427094228]

If I try to create the venv without sudo, I get a permission denied.

Thanks in advance

Cheers,
nrk

I already solved the issue.

Thanks!

Hey nrk,

Sorry for the delay - you caught me on vacation! Glad to hear you worked it out.

would be nice to know 'How you solved it" as I have same issues to install some other tools within awx web.