From 92c6283e93a48b3b7788398ae5ca8135beda0d31 Mon Sep 17 00:00:00 2001 From: Yannig Date: Tue, 23 Aug 2016 19:09:16 +0200 Subject: [PATCH] Add speed link in gathered facts for Linux. (#15347) --- lib/ansible/module_utils/facts.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index efe274cbad1..5b27d1e37c4 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -2271,6 +2271,10 @@ class LinuxNetwork(Network): interfaces[device]['all_slaves_active'] = get_file_content(path) == '1' 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')): + speed = get_file_content(os.path.join(path, 'speed')) + if speed is not None: + interfaces[device]['speed'] = int(speed) # Check whether an interface is in promiscuous mode if os.path.exists(os.path.join(path,'flags')):