salt.pillar.netbox

A module that adds data to the Pillar structure from a NetBox API.

New in version 2019.2.0.

Configuring the NetBox ext_pillar

ext_pillar:
  - netbox:
      api_url: http://netbox_url.com/api/
      api_token: 123abc

Create a token in your NetBox instance at http://netbox_url.com/user/api-tokens/

The following options are optional, and determine whether or not the module will attempt to configure the proxy pillar data for use with the napalm proxy-minion:

proxy_return: True
proxy_username: admin

By default, this module will query the NetBox API for the platform associated with the device, and use the 'NAPALM driver' field to set the napalm proxy-minion driver. (Currently only 'napalm' is supported for drivertype.)

This module currently only supports the napalm proxy minion and assumes you will use SSH keys to authenticate to the network device. If password authentication is desired, it is recommended to create another proxy key in pillar_roots (or git_pillar) with just the passwd key and use salt.renderers.gpg to encrypt the value. If any additional options for the proxy setup are needed they should also be configured in pillar_roots.

Other available options:

site_details: True

Whether should retrieve details of the site the device belongs to.

site_prefixes: True

Whether should retrieve the prefixes of the site the device belongs to.

salt.pillar.netbox.ext_pillar(minion_id, pillar, *args, **kwargs)

Query NetBox API for minion data