Execute the ipaddr filter after installation

839 views
Skip to first unread message

Evgeniy Ivanov

unread,
May 14, 2019, 10:38:50 AM5/14/19
to Ansible Project
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!

David Rojas

unread,
May 14, 2019, 11:53:20 PM5/14/19
to Ansible Project
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

Jack Ivanov

unread,
May 15, 2019, 12:50:45 AM5/15/19
to Ansible Project
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.

Jonathan Lozada De La Matta

unread,
May 15, 2019, 6:47:14 AM5/15/19
to ansible...@googlegroups.com
are you using a virtualenv?

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b096b3c1-ed8c-45d6-89c9-6c69eb52a6ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Jonathan Cha'gara Lozada De La Matta

He / Him / His

Automation Practice

Senior Automation Consultant & Automation CoP Manager

Red Hat


 

Reply all
Reply to author
Forward
0 new messages