mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Adding hwaddr_interfaces to grains, it permit to target minion based on Mac Address
This commit is contained in:
parent
763ca1c33e
commit
851878d8cf
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user