def ip4_interfaces():
 if salt.utils.is_proxy():
  return {}
 ret = {}
 ifaces = _get_interfaces()
 for face in ifaces:
  iface_ips = []
  for inet in ifaces[face].get('inet', []):
   if ('address' in inet):
    iface_ips.append(inet['address'])
  for secondary in ifaces[face].get('secondary', []):
   if ('address' in secondary):
    iface_ips.append(secondary['address'])
  ret[face] = iface_ips
 return {'ip4_interfaces': ret}

def ip4_interfaces ( ) : if salt . utils . is_proxy ( ) : return { } ret = { } ifaces = _get_interfaces ( ) for face in ifaces : iface_ips = [ ] for inet in ifaces [ face ] . get ( 'inet' , [ ] ) : if ( 'address' in inet ) : iface_ips . append ( inet [ 'address' ] ) for secondary in ifaces [ face ] . get ( 'secondary' , [ ] ) : if ( 'address' in secondary ) : iface_ips . append ( secondary [ 'address' ] ) ret [ face ] = iface_ips return { 'ip4_interfaces' : ret }
provide a dict of the connected interfaces and their ip4 addresses the addresses will be passed as a list for each interface .