diff --git a/ansible/filter_plugins/networks.py b/ansible/filter_plugins/networks.py index 313042498..0e2f3e471 100644 --- a/ansible/filter_plugins/networks.py +++ b/ansible/filter_plugins/networks.py @@ -171,6 +171,8 @@ def net_interface_obj(context, name, inventory_hostname=None): "Network interface for network '%s' on host '%s' not found" % (name, inventory_hostname)) ip = net_ip(context, name, inventory_hostname) + if ip is None: + ip = '0.0.0.0' cidr = net_cidr(context, name, inventory_hostname) netmask = net_mask(context, name, inventory_hostname) gateway = net_gateway(context, name, inventory_hostname) @@ -207,6 +209,8 @@ def net_bridge_obj(context, name, inventory_hostname=None): "Network interface for network '%s' on host '%s' not found" % (name, inventory_hostname)) ip = net_ip(context, name, inventory_hostname) + if ip is None: + ip = '0.0.0.0' cidr = net_cidr(context, name, inventory_hostname) netmask = net_mask(context, name, inventory_hostname) gateway = net_gateway(context, name, inventory_hostname) @@ -245,6 +249,8 @@ def net_bond_obj(context, name, inventory_hostname=None): "Network interface for network '%s' on host '%s' not found" % (name, inventory_hostname)) ip = net_ip(context, name, inventory_hostname) + if ip is None: + ip = '0.0.0.0' cidr = net_cidr(context, name, inventory_hostname) netmask = net_mask(context, name, inventory_hostname) gateway = net_gateway(context, name, inventory_hostname)