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

Netbox pillar enhancements - Virtual Machines, Interfaces, IP Addresses, Documentation #59500

Merged
merged 53 commits into from Aug 25, 2021

Conversation

ggiesen
Copy link
Contributor

@ggiesen ggiesen commented Feb 13, 2021

What does this PR do?

What issues does this PR fix or reference?

Fixes: #51490
Fixes: #59398

Previous Behavior

The Netbox pillar doesn't currently support displaying any information for virtual machines at all, or displaying interface and IP information

New Behavior

Set:

ext_pillar:
  - netbox:
      api_url: https://netbox.example.com/api/
      api_token: XXX
      devices: True
      virtual_machines: True
      interfaces: True
      interface_ips: True

Example output

host.example.com:
    ----------
    netbox:
        ----------
        interfaces:
            |_
              ----------
              cable:
                  None
              cable_peer:
                  None
              cable_peer_type:
                  None
              connected_endpoint:
                  None
              connected_endpoint_reachable:
                  None
              connected_endpoint_type:
                  None
              count_ipaddresses:
                  0
              description:
              enabled:
                  True
              id:
                  7453
              ip_addresses:
              label:
              lag:
                  None
              mac_address:
                  None
              mgmt_only:
                  False
              mode:
                  None
              mtu:
                  None
              name:
                  GigabitEthernet0/0
              tagged_vlans:
              tags:
              type:
                  ----------
                  label:
                      1000BASE-T (1GE)
                  value:
                      1000base-t
              untagged_vlan:
                  None
              url:
                  https://netbox.example.com/api/dcim/interfaces/7453/
            |_
              ----------
              cable:
                  None
              cable_peer:
                  None
              cable_peer_type:
                  None
              connected_endpoint:
                  None
              connected_endpoint_reachable:
                  None
              connected_endpoint_type:
                  None
              count_ipaddresses:
                  0
              description:
              enabled:
                  True
              id:
                  7454
              ip_addresses:
              label:
              lag:
                  None
              mac_address:
                  None
              mgmt_only:
                  False
              mode:
                  None
              mtu:
                  None
              name:
                  GigabitEthernet0/1
              tagged_vlans:
              tags:
              type:
                  ----------
                  label:
                      1000BASE-T (1GE)
                  value:
                      1000base-t
              untagged_vlan:
                  None
              url:
                  https://netbox.example.com/api/dcim/interfaces/7454/
            |_
              ----------
              cable:
                  None
              cable_peer:
                  None
              cable_peer_type:
                  None
              connected_endpoint:
                  None
              connected_endpoint_reachable:
                  None
              connected_endpoint_type:
                  None
              count_ipaddresses:
                  1
              description:
              enabled:
                  True
              id:
                  7455
              ip_addresses:
                  |_
                    ----------
                    address:
                        192.0.2.87/32
                    created:
                        2021-02-12
                    description:
                    dns_name:
                    family:
                        ----------
                        label:
                            IPv4
                        value:
                            4
                    id:
                        1113
                    last_updated:
                        2021-02-12T15:05:04.456156Z
                    nat_inside:
                        None
                    nat_outside:
                        None
                    role:
                        ----------
                        label:
                            Loopback
                        value:
                            loopback
                    status:
                        ----------
                        label:
                            Active
                        value:
                            active
                    tags:
                    tenant:
                        None
                    url:
                        https://netbox.example.com/api/ipam/ip-addresses/1113/
                    vrf:
                        ----------
                        display_name:
                            EXAMPLE (64512:23456)
                        id:
                            2
                        name:
                            EXAMPLE
                        rd:
                            64512:23456
                        url:
                            https://netbox.example.com/api/ipam/vrfs/2/
        node_type:
            device

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes/No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@ggiesen ggiesen requested a review from a team as a code owner February 13, 2021 21:55
@ggiesen ggiesen requested review from dwoz and removed request for a team February 13, 2021 21:55
@welcome
Copy link

welcome bot commented Feb 13, 2021

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at core@saltstack.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@ggiesen
Copy link
Contributor Author

ggiesen commented Feb 13, 2021

I'll work with @waynew during a test clinic to get tests implemented

@ggiesen ggiesen changed the title Netbox pillar enhancements - Virtual Machines, Interfaces, and IP Addresses WIP: Netbox pillar enhancements - Virtual Machines, Interfaces, and IP Addresses Feb 14, 2021
@ggiesen ggiesen changed the title WIP: Netbox pillar enhancements - Virtual Machines, Interfaces, and IP Addresses WIP: Netbox pillar enhancements - Virtual Machines, Interfaces, IP Addresses, Documentation Feb 27, 2021
@ggiesen ggiesen changed the title WIP: Netbox pillar enhancements - Virtual Machines, Interfaces, IP Addresses, Documentation Netbox pillar enhancements - Virtual Machines, Interfaces, IP Addresses, Documentation Mar 2, 2021
@ggiesen
Copy link
Contributor Author

ggiesen commented Mar 5, 2021

re-run pr-macosxcatalina-py3-pytest

requirements/static/ci/py3.5/darwin.txt Outdated Show resolved Hide resolved
@sagetherage sagetherage added the Silicon v3004.0 Release code name label May 19, 2021
@ggiesen ggiesen requested a review from dwoz July 8, 2021 21:55
@ggiesen
Copy link
Contributor Author

ggiesen commented Jul 9, 2021

re-run pr-freebsd-130-amd64-py3-pytest

@Ch3LL
Copy link
Contributor

Ch3LL commented Jul 15, 2021

bump @dwoz can you re-review here please

@garethgreenaway garethgreenaway merged commit 9a16aa4 into saltstack:master Aug 25, 2021
dwoz pushed a commit to dwoz/salt that referenced this pull request Sep 12, 2021
…es, Documentation (saltstack#59500)

* Add support for virtual machines, interfaces, and IP addresses.

* Enhance netbox pillar, add tests

* Add changelog for 51490

* Expanded the documentation for the netbox pillar (resolves saltstack#59398)

* Add reqs for windows

* Add more tests, remove IPv4-specific code

* Some documentation and comment cleanups

* Remove URL validation, dependency on validators package, use salt.utils.url for URL protocol validation

* Remove more instances of validators python package

* Rework documentation for python3 version of jupyter console (which has been split out from IPython). Fixes saltstack#59741

* Remove errant '?'

* Change debian python3-jupyter-console to jupyter-console to get the front-end script (which will also install python3-jupyter-console lib)

* Fix openconfig links

* Revert "Change debian python3-jupyter-console to jupyter-console to get the front-end script (which will also install python3-jupyter-console lib)"

This reverts commit 4d6b15a.

* Revert "Remove errant '?'"

This reverts commit 546a859.

* Revert "Rework documentation for python3 version of jupyter console (which has been split out from IPython). Fixes saltstack#59741"

This reverts commit 69764e3.

* Add NetBox API pagination support, clean up logging

* Update changelog to fix typos and remove reference to removed validators dependency

* Clean up logging, update tests

* Re-run changes with pre-commit

* Further logging cleanups, pre-commit changes

* More pre-commit changes

Co-authored-by: Sage the Rage <36676171+sagetherage@users.noreply.github.com>
@ggiesen ggiesen deleted the netbox_pillar_enhancements branch June 2, 2022 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Silicon v3004.0 Release code name
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOCS] Netbox external pillar docs improvements salt.pillar.netbox: interfaces?
5 participants