AWX task failure for python netaddr

All,

this is the message I execute a task that requires ipaddr filter

{
“msg”: “The ipaddr filter requires python’s netaddr be installed on the ansible controller”,
“_ansible_no_log”: false
}

I know that netaddr is installed because I ran a ‘pip list’ command before the failure. See below.

The play book works from the ansible controller i have developed on, both in Debian & Centos versions.
I am using AWX v19.2.2
Playbooks use a remote node to execute against.

I even have a task to install netaddr which says it is successful but i see this message

Not sure if the PATH comment is something i need to change in my role to make it work on AWX.

{
“changed”: true,
“cmd”: [
“/usr/local/bin/pip3”,
“install”,
“netaddr”
],
“name”: [
“netaddr”
],
“version”: null,
“state”: “present”,
“requirements”: null,
“virtualenv”: null,
“stdout”: “Defaulting to user installation because normal site-packages is not writeable\nCollecting netaddr\n Downloading netaddr-0.8.0-py2.py3-none-any.whl (1.9 MB)\nInstalling collected packages: netaddr\nSuccessfully installed netaddr-0.8.0\n”,
“stderr”: " WARNING: The script netaddr is installed in ‘/home/runner/.local/bin’ which is not on PATH.\n Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\nWARNING: You are using pip version 21.1.3; however, version 22.0.3 is available.\nYou should consider upgrading via the ‘/usr/bin/python3 -m pip install --upgrade pip’ command.\n",
“invocation”: {
“module_args”: {
“name”: [
“netaddr”
],
“state”: “present”,
“virtualenv_site_packages”: false,
“virtualenv_command”: “virtualenv”,
“editable”: false,
“version”: null,
“requirements”: null,
“virtualenv”: null,
“virtualenv_python”: null,
“extra_args”: null,
“chdir”: null,
“executable”: null,
“umask”: null
}
},
“stdout_lines”: [
“Defaulting to user installation because normal site-packages is not writeable”,
“Collecting netaddr”,
" Downloading netaddr-0.8.0-py2.py3-none-any.whl (1.9 MB)“,
“Installing collected packages: netaddr”,
“Successfully installed netaddr-0.8.0”
],
“stderr_lines”: [
" WARNING: The script netaddr is installed in ‘/home/runner/.local/bin’ which is not on PATH.”,
" Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.",
“WARNING: You are using pip version 21.1.3; however, version 22.0.3 is available.”,
“You should consider upgrading via the ‘/usr/bin/python3 -m pip install --upgrade pip’ command.”
],
“_ansible_no_log”: false
}

Hi!

If that pip list from the control plane node? All jobs now run in execution environments https://docs.ansible.com/automation-controller/latest/html/userguide/execution_environments.html

The default execution environment is pulled from quay.io/awx/awx-ee. When you launch a job via AWX, podman will create a fresh container from that image, your playbook is mounted into that container and ansible-runner will run the plays.

When I do a pip list on that awx-ee container, I see the following (truncated)

munch 2.5.0
ncclient 0.6.12
netifaces 0.11.0
nsx-policy-python-sdk 3.1.3.2.0
nsx-python-sdk 3.1.3.2.0
nsx-vmc-aws-integration-python-sdk 3.1.3.2.0
nsx-vmc-policy-python-sdk 3.1.3.2.0
ntlm-auth 1.5.0
oauthlib 3.2.0

You may need to build your own execution environment https://ansible-builder.readthedocs.io/en/stable/

Let me know if that is helpful.

Seth