PR to implement ansible_net_model for iosxr facts module (#58488)

* resolves 57767

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* added test

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
(cherry picked from commit 539f37ede3)

Handle lowercase in version info (#59565)

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
(cherry picked from commit 3a103405b1)

Add changelog for iosxr_facts fix

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
pull/59827/head
Sumit Jaiswal 7 years ago committed by Toshio Kuratomi
parent 95fd0d58e6
commit 35ba55599a

@ -0,0 +1,2 @@
bugfixes:
- Fixed issue where `ansible_net_model` was not being populated in iosxr_facts (https://github.com/ansible/ansible/pull/58488)

@ -84,6 +84,10 @@ ansible_net_python_version:
description: The Python version Ansible controller is using
returned: always
type: str
ansible_net_model:
description: The model name returned from the device
returned: always
type: str
# hardware
ansible_net_filesystems:

@ -60,9 +60,12 @@ class Cliconf(CliconfBase):
if match:
device_info['network_os_image'] = match.group(1)
match = re.search(r'^Cisco (.+) \(revision', data, re.M)
if match:
device_info['network_os_model'] = match.group(1)
model_search_strs = [r'^[Cc]isco (.+) \(revision', r'^[Cc]isco (\S+ \S+).+bytes of .*memory']
for item in model_search_strs:
match = re.search(item, data, re.M)
if match:
device_info['network_os_model'] = match.group(1)
break
match = re.search(r'^(.+) uptime', data, re.M)
if match:

@ -9,8 +9,6 @@
provider: "{{ cli }}"
register: result
- assert:
that:
# _facts modules should never report a change
@ -21,7 +19,7 @@
- "'hardware' in result.ansible_facts.ansible_net_gather_subset"
- "'default' in result.ansible_facts.ansible_net_gather_subset"
- "'interfaces' in result.ansible_facts.ansible_net_gather_subset"
- "result.ansible_facts.ansible_net_model == 'IOS XRv'"
# Items from those subsets are present
- "result.ansible_facts.ansible_net_filesystems is defined"

Loading…
Cancel
Save