mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #9490 from yannj-fr/develop
Adding hwaddr_interfaces to grains, it permit to target minion based on ...
This commit is contained in:
commit
f6048017f7
@ -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