From 66818050b0a0aec6af1b7f5bc5c41f15c7961833 Mon Sep 17 00:00:00 2001 From: Christian Albrecht Date: Tue, 21 Mar 2017 21:29:38 +0100 Subject: [PATCH] Add perm_hwaddr on Linux bonding slave nics (#19071) This patch will additionally report the `perm_hwaddr` fact of a Linux bonding slave network interface. Related to issue #19067 --- lib/ansible/module_utils/facts.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 09b1071e73..79f4f70d55 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -2546,6 +2546,8 @@ class LinuxNetwork(Network): path = os.path.join(path, 'bonding', 'all_slaves_active') if os.path.exists(path): interfaces[device]['all_slaves_active'] = get_file_content(path) == '1' + if os.path.exists(os.path.join(path, 'bonding_slave')): + interfaces[device]['perm_macaddress'] = get_file_content(os.path.join(path, 'bonding_slave', 'perm_hwaddr'), default='') if os.path.exists(os.path.join(path,'device')): interfaces[device]['pciid'] = os.path.basename(os.readlink(os.path.join(path,'device'))) if os.path.exists(os.path.join(path, 'speed')):