summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTrishna Guha <trishnaguha17@gmail.com>2019-02-01 11:11:00 +0530
committerGitHub <noreply@github.com>2019-02-01 11:11:00 +0530
commit9df6f152e1f293c066aaa45eef2f903cddec738e (patch)
tree451ad6cf4ee381fd3be6c17994f323715c51ee22 /lib
parent240d1a6afb43982f16acebef16778d17aab58160 (diff)
downloadansible-9df6f152e1f293c066aaa45eef2f903cddec738e.tar.gz
add license_hostid fact nxos_facts (#51588)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/ansible/modules/network/nxos/nxos_facts.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/ansible/modules/network/nxos/nxos_facts.py b/lib/ansible/modules/network/nxos/nxos_facts.py
index 8fb7e519fc..c771795ba3 100644
--- a/lib/ansible/modules/network/nxos/nxos_facts.py
+++ b/lib/ansible/modules/network/nxos/nxos_facts.py
@@ -261,6 +261,10 @@ class Default(FactsBase):
self.facts['image'] = self.parse_image(data)
self.facts['hostname'] = self.parse_hostname(data)
+ data = self.run('show license host-id')
+ if data:
+ self.facts['license_hostid'] = self.parse_license_hostid(data)
+
def parse_version(self, data):
match = re.search(r'\s+system:\s+version\s*(\S+)', data, re.M)
if match:
@@ -294,6 +298,11 @@ class Default(FactsBase):
if match:
return match.group(1)
+ def parse_license_hostid(self, data):
+ match = re.search(r'License hostid: VDH=(.+)$', data, re.M)
+ if match:
+ return match.group(1)
+
class Config(FactsBase):