netaddr filter and AWX

,

Hello, i know i may duplicate, but i need some clarification on using netaddr filter with AWX 20.0.1

So, the problem is that i use the playbook which uses ipv4|ipv6 filters. Getting this error:

““The conditional check ‘ipv4list.stdout_lines != (ipv4list.stdout_lines|ipv4)’ failed. The error was: The ipv4 filter requires python’s netaddr be installed on the ansible controller””

Tried to install it via pip install:

  • name: Install python package
    ansible.builtin.pip:
    name: netaddr
    delegate_to: 127.0.0.1

but it doesn’t help - same message appears.

As i googled i need to create the new execution environment, but I dont understand why - why it’s not enough to install the netaddr with pip in currently spawned container ?

Or maybe is there any easier way to workaround this issue ? Thank you

AWX runs ansible-runner which create a container from the Execution Environments for the automation to run inside=.
So installing netaddr with pip inside a current container won’t help because an EE container will be spun up and the automation run there.
In theory, if you had a long “sleep” in your playbook and installed netaddr inside the running EE container before the task that would work but you would have to do that for every execution.

There is a nice little blog post about creating EEs with Ansible Builder here as a reference.

-The AWX Team

Yeah - had the same problem and needed to install netaddr within the EE. For a starter I started the EE via docker and installed netaddr within the image, comitted it and uploaded it to a registry. But on the long run, it’s probably better to have full control over the EE build…