Proxy Minion interface module for managing (practically) any network device with Cisco Network Services Orchestrator (Cisco NSO). Cisco NSO uses a series of remote polling agents, APIs and SSH commands to fetch network configuration and represent it in a data model. PyNSO, the Python module used by this proxy minion does the task of converting native Python dictionaries into NETCONF/YANG syntax that the REST API for Cisco NSO can then use to set the configuration of the target network device.
New in version 2016.11.0.
codeauthor: | Anthony Shaw <[email protected]> |
---|
This proxy minion enables a consistent interface to fetch, control and maintain the configuration of network devices via a NETCONF-compliant control plane. Cisco Network Services Orchestrator.
More in-depth conceptual reading on Proxy Minions can be found in the Proxy Minion section of Salt's documentation.
PyNSO can be installed via pip:
pip install pynso
To use this integration proxy module, please configure the following:
Proxy minions get their configuration from Salt's Pillar. Every proxy must have a stanza in Pillar and a reference in the Pillar top-file that matches the ID. At a minimum for communication with the NSO host, the pillar should look like this:
proxy: proxytype: cisconso host: <ip or dns name of host> port: 8080 use_ssl: false username: <username> password: password
The proxytype
key and value pair is critical, as it tells Salt which interface to load from the proxy
directory in Salt's install hierarchy, or from /srv/salt/_proxy
on the Salt Master (if you have created your own proxy module, for example). To use this Cisco NSO Proxy Module, set this to cisconso
.
The location, or IP/dns, of the Cisco NSO API host. Required.
The username used to login to the Cisco NSO host, such as admin
. Required.
The password for the given user. Required.
Whether to use HTTPS messaging to speak to the API.
The port that the Cisco NSO API is running on, 8080 by default
After your pillar is in place, you can test the proxy. The proxy can run on any machine that has network connectivity to your Salt Master and to the Cisco NSO host in question. SaltStack recommends that the machine running the salt-proxy process also run a regular minion, though it is not strictly necessary.
On the machine that will run the proxy, make sure there is an /etc/salt/proxy
file with at least the following in it:
master: <ip or hostname of salt-master>
You can then start the salt-proxy process with:
salt-proxy --proxyid <id you want to give the host>
You may want to add -l debug
to run the above in the foreground in debug mode just to make sure everything is OK.
Next, accept the key for the proxy on your salt-master, just like you would for a regular minion:
salt-key -a <id you gave the cisconso host>
You can confirm that the pillar data is in place for the proxy:
salt <id> pillar.items
And now you should be able to ping the Cisco NSO host to make sure it is responding:
salt <id> test.ping
Apply a system rollback
Parameters: |
|
---|
Get the configuration of the device tree at the given path
Parameters: |
|
---|---|
Returns: |
The network configuration at that tree |
Return type: |
|
salt cisco-nso cisconso.get_data devices
Get the backup of stored a configuration rollback
Parameters: |
name (str ) -- Typically an ID of the backup |
---|---|
Return type: | str |
Returns: | the contents of the rollback snapshot |
Get a list of stored configuration rollbacks
Get the grains from the proxy device.
Check to see if the host is responding. Returns False if the host didn't respond, True otherwise.
CLI Example:
salt cisco-nso test.ping
Get a data entry in a datastore
Parameters: |
|
---|---|
Return type: |
|
Returns: |
|
Shutdown the connection to the proxy device. For this proxy, shutdown is a no-op.
© 2019 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltstack.com/en/latest/ref/proxy/all/salt.proxy.cisconso.html