Skip to content
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

Feature nautobot inventory #934

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

housepbass
Copy link

@housepbass housepbass commented Apr 8, 2024

Related Issue

Fixes #921

Description

Nautobot has been added as a dynamic inventory source for SuzieQ.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

New Behavior

Users can now specify nautobot as an inventory source for SuzieQ. The feature uses Pynautobot and allows for Nautobot 2.x support. Filtering is possible using pynautobot's filters:

sources:
  - name: nautobot-instance
    token: 0123456789abcdef0123456789abcdef01234567
    url: http://localhost:8080
    ssl-verify: false
    type: nautobot
    period: 3600
    device_filters: # pynautobot filters
      location: "Athens, GA"
      role: "Spine"

Contrast to Current Behavior

Nautobot is not currently supported.

Discussion: Benefits and Drawbacks

  • I have read the comments and followed the CONTRIBUTING.md.
  • I have explained my PR according to the information in the comments or in a linked issue.
  • My PR source branch is created from the develop branch.
  • My PR targets the develop branch.
  • All my commits have --signoff applied (Only my last commit has this, how can I remediate?)

@housepbass housepbass force-pushed the feature_nautobot_inventory branch from d476abf to e7aa786 Compare April 8, 2024 20:27
docs/inventory.md Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
suzieq/poller/controller/source/nautobot.py Outdated Show resolved Hide resolved
Comment on lines 151 to 165
if self._data.device_filters:
devices = self._session.dcim.devices.filter(**self._data.device_filters)
else:
devices = self._session.dcim.devices.all()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In netbox, this function handles NSOT servers behind a proxy. Do you know if the pynautobot automatically handles these kind of problems?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about that.

suzieq/poller/controller/source/nautobot.py Outdated Show resolved Hide resolved
Anthony House and others added 15 commits April 9, 2024 20:46
Signed-off-by: Anthony House <[email protected]>
Signed-off-by: Anthony House <[email protected]>
Signed-off-by: Anthony House <[email protected]>
Signed-off-by: Anthony House <[email protected]>
Signed-off-by: Anthony House <[email protected]>
Signed-off-by: Anthony House <[email protected]>
Co-authored-by: Luca Nicosia <[email protected]>
Signed-off-by: Anthony House <[email protected]>
Signed-off-by: Anthony House <[email protected]>
@housepbass housepbass force-pushed the feature_nautobot_inventory branch from fb00461 to 0bcf819 Compare April 10, 2024 00:46
Signed-off-by: Anthony House <[email protected]>
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.

[Feature]: custom netbox queries / add nautobot 2.X support
2 participants