Using the NetBox Roster

To be able to use the NetBox Roster, you will need to have the pynetbox library installed in the same environment as salt-sproxy, e.g.,

$ pip install pynetbox

Using the Master configuration file under examples/netbox/master:


    - /srv/salt/pillar

proxy_roster: netbox

  url: https://url-to-your-netbox-instance

With this configuration, the list of devices is going to be loaded from NetBox, with the connection details provides under the netbox key.


To set up a NetBox instance, see the installation notes from

The pillar_roots option points to /srv/salt/pillar, so to be able to use this example, either create a symlink to the pillar directory in this example, or copy the files. For example, if you just cloned this repository:

$ mkdir -p /srv/salt/pillar
$ git clone
$ cp salt-sproxy/examples/netbox/master /etc/salt/master
$ cp salt-sproxy/examples/netbox/pillar/*.sls /srv/salt/pillar/

The contents of these files highly depend on the device names you have in your NetBox instance. The following examples are crafted for device name starting with edge1 and edge2, e.g., edge1.atlanta, edge1.seattle etc. If you have different device names in your NetBox instance, you’ll have to update these Pillars.


    - junos
    - eos

With this top file, Salt is going to load the Pillar data from /srv/salt/pillar/junos.sls for edge1.seattle, edge1.atlanta, edge1.raleigh, edge1.sfo, and, while loading the data from /srv/salt/pillar/eos.sls for edge2.atlanta (and anything that would match the edge2* expression should you have others).


  proxytype: napalm
  driver: junos
  host: {{ | replace('.', '-') }}
  username: test
  password: t35t1234


  proxytype: napalm
  driver: eos
  host: {{ | replace('.', '-') }}
  username: test
  password: t35t1234

Note that in both case the hostname has been set as {{ | replace('.', '-') }} points to the Minion ID, which means that the Pillar data is rendered depending on the name of the device; therefore, the hostname for edge1.atlanta will be, the hostname for edge2.atlanta is, and so on.

Having this setup ready, you can go ahead an execute:

$ salt-sproxy '*' --preview-target
- edge1.seattle
- edge1.vancouver
- edge1.atlanta
- edge2.atlanta
- edge1.raleigh
- edge1.sfo
~~~ many others ~~~

# get the LLDP neighbors from all the edge devices
$ salt-sproxy 'edge*' net.lldp
    ~~~ snip ~~~
    ~~~ snip ~~~
    ~~~ snip ~~~
    ~~~ snip ~~~
    ~~~ snip ~~~
    ~~~ snip ~~~
    ~~~ snip ~~~

Alternative setup using Docker

  1. Clone the salt-sproxy repository and change dir:
$ git clone
$ cd salt-sproxy/
  1. Update examples/netbox/master with your NetBox details (URL and token).

    Alternatively, for quick testing, you can also leave the existing values, to use the demo instance available at

  2. Using the allinone-latest Docker image (see Docker), you can run from this path (at the repository root):

$ docker run --rm -v $PWD/examples/netbox/master:/etc/salt/master \
    -v $PWD/examples/netbox/pillar/:/srv/salt/pillar/ \
    --network host \
    -ti mirceaulinic/salt-sproxy:allinone-latest bash

root@2c68721d93dc:/# salt-sproxy \* --preview-target
- edge1.vlc1