From b4ed3a4f529b124b277639290d49d4edb334b2c7 Mon Sep 17 00:00:00 2001 From: Charles Paul Date: Wed, 6 Jan 2016 10:57:52 -0600 Subject: [PATCH] properly handle addresses on /31 networks --- lib/ansible/plugins/filter/ipaddr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/filter/ipaddr.py b/lib/ansible/plugins/filter/ipaddr.py index 432de6031b..76406e45a0 100644 --- a/lib/ansible/plugins/filter/ipaddr.py +++ b/lib/ansible/plugins/filter/ipaddr.py @@ -80,7 +80,8 @@ def _ip_query(v): if v.size == 1: return str(v.ip) if v.size > 1: - if v.ip != v.network: + # /31 networks in netaddr have no broadcast address + if v.ip != v.network or not v.broadcast: return str(v.ip) def _gateway_query(v):