networktocode/ntc-netbox-plugin-onboarding

Possibility to add a label while onbaording

misch42 opened this issue · 4 comments

Environment

  • Python version: 3.6.8
  • NetBox version: 2.8.7
  • ntc-netbox-plugin-onboarding version: 1.2.0

It would be nice to have the possibilty to add a label to onboarded devices. This could help when automating the follow-up processes after onboarding new devices.

Example:

  1. Onboard a new device with the label "new"
  2. For all devices with the label "new"
    2.1 Trigger the collection of interface information
    2.2 Delete the label "new"

So after onbaording a new deivce, additional information could be collected.

Proposed Functionality

See above

Use Case

See above

Thanks @misch42, it would be a great addition.
For the time being, I would suggest to onboard the new devices with different status like staged or planned.

Yes. This would be even better. But hte onboarding pluging also does not offer to set the "Status" of new device. At least the config option does not work for me.

See issue #58

In release 2.0 we introduced the onboarding extensions with an example as follows : https://github.com/networktocode/ntc-netbox-plugin-onboarding/blob/develop/docs/examples/example_ios_set_device_role.py - your use case is a perfect candidate for creating an extension.

Solution could be similar to the following one :

class MyOnboardingClass(Onboarding):
    def run(self, onboarding_kwargs):
        nb_k = NetboxKeeper(**onboarding_kwargs)
        nb_k.ensure_device()

        nb_k.device.tags.add("YOUR_LABEL_TAG")

        self.created_device = nb_k.device