Adding hwaddr_interfaces to grains, it permit to target minion based on Mac Address

This commit is contained in:
yannj-fr 2013-12-30 17:52:24 +01:00
parent 763ca1c33e
commit 851878d8cf

View File

@ -1079,6 +1079,20 @@ def ip_interfaces():
return {'ip_interfaces': ret}
def hwaddr_interfaces():
'''
Provide a dict of the connected interfaces and their hw addresses (Mac Address)
'''
# Provides:
# hwaddr_interfaces
ret = {}
ifaces = salt.utils.network.interfaces()
for face in ifaces:
if 'hwaddr' in ifaces[face]:
ret[face] = ifaces[face]['hwaddr']
return {'hwaddr_interfaces': ret}
def path():
'''
Return the path