Skip to content

Conversation

@timway
Copy link

@timway timway commented Apr 9, 2025

SUMMARY
  • 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.
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

ios_facts

ADDITIONAL INFORMATION

show version from a Stratix 5800

...
Allen-Bradley 1783-MMS10AR (ARM) processor (revision V03)
...

show version from a Cisco IE3400

cisco IE-3400-8T2S (ARM) processor (revision V06)

* 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",
Copy link
Member

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.

Copy link
Author

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": {}
    }
}

@Ruchip16 Ruchip16 marked this pull request as draft April 24, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants