Execute the ipaddr filter after installation

Hi there,

I’ve got a problem with the ipaddr filter. It doesn’t seem to be loaded after installed in the same playbook:

example:

`

  • pip: name=netaddr state=latest

  • debug: msg=“{{ ‘192.0.2.0’ | ipaddr }}”

`

gives an error:

TASK [debug] ***********************************************************************************************************************************************************************************************

fatal: [localhost]: FAILED! => {“msg”: “The ipaddr filter requires python-netaddr be installed on the ansible controller”}

It seems that netaddr should be in the system before evoking ansible.

Is there any workaround to load the filter in the same playbook?

Thanks!

You are installing it on the target device but it needs to be installed on the absolve engine node basically where you are running your playbook from. Just do a pip install for that module once then rerun your playbook but take out that pip install not needed on your target

No, this is not the case, I’m running the playbook on localhost and deploying to localhost. The problem is that python is not reloading the cache for each task.

are you using a virtualenv?