-
Notifications
You must be signed in to change notification settings - Fork 186
Support ansible_net_model for Rockwell / Allen-Bradley Cisco Switches
#1176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
* Rockwell through Allen-Bradley sell switches that run Cisco IOS like the Stratix 5800 series. This adds support for their model numbers to be detected.
| device_info["network_os_version"] = match.group(1).strip(",") | ||
|
|
||
| model_search_strs = [ | ||
| r"^[Aa]llen[ -][Bb]radley (.+) \(revision", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! 🙌
Could you please confirm that the facts gathered by this change are being parsed correctly — especially the model and other relevant fields — using the updated regex patterns? It would also be helpful if you could share the ansible_facts output from devices like the Stratix 5800 and Cisco IE3400 to verify that the model is detected as expected.
Additionally, could we consider adding a basic test case to validate that the regex reliably captures the correct values from show version output? This would help ensure the change is robust and doesn’t break other matches in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks at @Ruchip16 for taking a look! I will look if I can find a good place to mock out a unit test for this. There is a test case for the legacy ios_facts module but I think it comes in after the show version output is processed. Here is a dump of ansible_facts on 3 devices in the current (not patched) state:
TASK [ansible.builtin.debug] ***********************************************************************************************************************************************
ok: [ie-3400] => {
"ansible_facts": {
"net_api": "cliconf",
"net_gather_network_resources": [],
"net_gather_subset": [
"default"
],
"net_hostname": “ie-3400",
"net_image": "flash:packages.conf",
"net_iostype": "IOS-XE",
"net_model": "IE-3400-8T2S",
"net_operatingmode": "controller",
"net_python_version": "3.12.5",
"net_serialnum": “ABC1234Y2Y2",
"net_stacked_models": [
"IE-3400-8T2S"
],
"net_stacked_serialnums": [
"ABC1234Y2Y2"
],
"net_system": "ios",
"net_version": "17.12.04",
"net_virtual_switch": "STACK",
"network_resources": {}
}
}
ok: [ie-9320] => {
"ansible_facts": {
"net_api": "cliconf",
"net_gather_network_resources": [],
"net_gather_subset": [
"default"
],
"net_hostname": “ie-9320",
"net_image": "flash:packages.conf",
"net_iostype": "IOS-XE",
"net_model": "IE-9320-22S2C4X",
"net_operatingmode": "controller",
"net_python_version": "3.12.5",
"net_serialnum": “FGH1234J77S",
"net_stacked_models": [
"IE-9320-22S2C4X"
],
"net_stacked_serialnums": [
"FGH1234J77S"
],
"net_system": "ios",
"net_version": "17.12.04",
"net_virtual_switch": "STACK",
"network_resources": {}
}
}
ok: [stratix-5800] => {
"ansible_facts": {
"net_api": "cliconf",
"net_gather_network_resources": [],
"net_gather_subset": [
"default"
],
"net_hostname": “stratix-5800",
"net_image": "flash:packages.conf",
"net_iostype": "IOS-XE",
"net_operatingmode": "controller",
"net_python_version": "3.12.5",
"net_serialnum": “CDE1234Y1KQ",
"net_stacked_models": [
"1783-MMS10AR"
],
"net_stacked_serialnums": [
"CDE1234Y1KQ"
],
"net_system": "ios",
"net_version": "17.12.04",
"net_virtual_switch": "STACK",
"network_resources": {}
}
}
SUMMARY
ISSUE TYPE
COMPONENT NAME
ios_facts
ADDITIONAL INFORMATION