nautobot/nautobot-app-device-onboarding

Add Support to Try Multiple Commands

Opened this issue · 2 comments

Environment

  • Nautobot version: <2.2.3>
  • nautobot-device-onboarding version: <4.0.1rc2->

Proposed Functionality

Use Case

Ability to onboard more devices with unique command structures.

Agree - show version on Cisco devices should provide information but it's fairly unstructured text. show inventory provides a much better formatted dump of information based on PID: and SN: and will be useful for pulling line card info on larger chassis (and clustered systems).

The key element to this is to know when/what constitutes a "passing" condition. If you try multiple commands and the commands and/jmespath render an actual result, should you continue? stop? etc. My initial thought when I was writing the yaml file was to implement a "validator_pattern" of sorts.

  serial:
    commands:
      - command: "show version"
        parser: "textfsm"
        jpath: "[*].serial_number"
      - command: "show inventory"
        parser: "textfsm"
        jpath: "[*].serial_number"
    validator_pattern: <maybe a function/regex/other>

Where if the first command is tried/parsed, if the post-processed data doesn't match the validator pattern it moves on to the next command.