Skip to main content

NAPALM modules for Salt, to facilitate vendor-agnostic event-driven network automation and orchestration

Project description

napalm-salt

Modules for Salt, to retrieve, control, enforce and update configuration of network devices

Salt Basics

New to Salt? Check out this document for a brief introduction to get up to speed on the basics.

Test Environment

Throughout the rest of this document, we’ll set up a test environment to run some salt commands against routers. This test environment uses a vagrant VM running Ubuntu 16.04, which acts as a salt-master as well as a proxy-master, which establishes and maintains connections to the routers in order to execute commands on them.

Install Salt

The simplest way to install Salt is via salt bootstrap. Here’s an example of an installation:

wget -O bootstrap-salt.sh https://bootstrap.saltstack.com/develop
sudo sh bootstrap-salt.sh

This will install the salt-minion and salt-proxy only, but we also want this box to be the salt-master, so we’ll install that:

sudo sh bootstrap-salt.sh -M

For more specific installation instructions, see the platform-specific instructions from the official Saltstack documentation. Be aware to install the master distribution from the PPA repo, as on the local server will run as Master, controlling the devices as Proxy minions.

CentOS documentation can be found here.

Install NAPALM

If NAPALM has never been installed on your system it will need to be before napalm-salt can work:

sudo apt-get install libffi-dev libssl-dev python-dev python-cffi libxslt1-dev python-pip
sudo pip install --upgrade cffi
sudo pip install napalm-junos napalm-iosxr napalm-ios

The easy way: Salt users can install NAPALM through a single command, using the napalm-install Saltstack formula. A more detailed usage example can be found at: https://mirceaulinic.net/2017-07-06-napalm-install-formula/.

Configure Salt Proxy (and Minion)

The main configuration file needed to make Salt run as proxy-master is located at /etc/salt/proxy. This file should already exist, though you may need to create it.

We need to tell the proxy process that the local machine is the salt-master, and to turn off multiprocessing. You can add the following to the top of your /etc/salt/proxy file:

master: localhost
multiprocessing: false
mine_enabled: true # not required, but nice to have
pki_dir: /etc/salt/pki/proxy # not required - this separates the proxy keys into a different directory

Additionally, you may want to edit the /etc/salt/minion file to point the master location to itself. This is not necessary, but it allows you to target the VM as a minion, i

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napalm-salt-0.0.2.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file napalm-salt-0.0.2.tar.gz.

File metadata

File hashes

Hashes for napalm-salt-0.0.2.tar.gz
Algorithm Hash digest
SHA256 99ae976716425171b200b6783b674d376a46096fa1419a3993107214afe60f2e
MD5 d9a6b26d8c6ce9df70781ad151e99d89
BLAKE2b-256 0af7875402e1485f26c027aa089cfb1902fd52511c10869bf6c665365ca2aa1c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page