# ipaddr filter positive integer as a query seems not to work the same in Ansible 2.8

**URL:** <https://forum.ansible.com/t/ipaddr-filter-positive-integer-as-a-query-seems-not-to-work-the-same-in-ansible-2-8/30427>\
**Category:** Ansible Project\
**Created:** [May 27, 2019, 9:49am UTC](https://forum.ansible.com/t/ipaddr-filter-positive-integer-as-a-query-seems-not-to-work-the-same-in-ansible-2-8/30427 "2019-05-27T09:49:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick\_Tuite](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/patrick_tuite/32/2961_2.png) [@Patrick\_Tuite](https://forum.ansible.com/u/Patrick_Tuite)\
**Post date:** [May 27, 2019, 9:49am UTC](https://forum.ansible.com/t/ipaddr-filter-positive-integer-as-a-query-seems-not-to-work-the-same-in-ansible-2-8/30427/1 "2019-05-27T09:49:27Z")

</div>

Hi folks

We have a filter working up till v2.7

`  
“{{ v\_overlay\_network | ipaddr(‘net’) | ipaddr(‘191’) | ipaddr(‘address’) if v\_overlay\_network is defined and v\_overlay\_network | ipaddr else 198.19.0.191 }}”

`

In this case **v\_overlay\_network** is defined (198.19.0.0/16)  
Now alway produces **False** in v2.8

I think I’ve isolated it to the ipaddr integer host query, where positive integers return nothing, but negative integers work as expected

`

TASK [DEBUG print positive v\_overlay\_network msg={{ v\_overlay\_network | ipaddr(‘net’) | ipaddr(‘254’) }}] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost] =\> {  
“msg”: “”  
}

TASK [DEBUG print negative v\_overlay\_network msg={{ v\_overlay\_network | ipaddr(‘net’) | ipaddr(‘-64’) }}] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost] =\> {  
“msg”: “198.19.255.192/16”  
}

`

Not sure if I missed something in the Porting Guide or if I have hit a bug?

> $ python --version  
> Python 2.7.5

> ## $ pip show ansible
> 
> Metadata-Version: 2.1  
> Name: ansible  
> Version: 2.8.0

> 

> $ pip show jinja2

> * * *

> Metadata-Version: 2.1

> Name: Jinja2

> Version: 2.10.1

Thanks  
Patrick

---

<div class="post-metadata">

**Author:** ![Patrick\_Tuite](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/patrick_tuite/32/2961_2.png) [@Patrick\_Tuite](https://forum.ansible.com/u/Patrick_Tuite)\
**Post date:** [May 28, 2019, 6:17am UTC](https://forum.ansible.com/t/ipaddr-filter-positive-integer-as-a-query-seems-not-to-work-the-same-in-ansible-2-8/30427/2 "2019-05-28T06:17:40Z")

</div>

OK, found an open issue on this  
[https://github.com/ansible/ansible/issues/55570](https://github.com/ansible/ansible/issues/55570)
