Troubleshooting Junos Execution Module Errors When Using Salt to Manage Devices Running Junos OS
Problem
Description
After starting the proxy minion process for a device running Junos OS and accepting the key on the Salt master, the Junos proxy (for Salt) connects to the device, but when you execute a function from the Junos execution module, it returns an error. For example:
saltuser@salt-master:~$ sudo salt 'router1' test.ping router1: True
saltuser@salt-master:~$ sudo salt 'router1' junos.cli 'show version' router1: 'junos' __virtual__ returned False: The junos or dependent module could not be loaded: junos-eznc or jxmlease or yamlordereddictloader or proxy could not be loaded.
Cause
The Junos proxy minion server must have the Juniper Network’s
Junos PyEZ library (junos-eznc
) and jxmlease
Python module as well as the yamlordereddictloader
Python module installed on the
server in order to use Salt to manage devices running Junos OS.
Solution
Install Junos PyEZ and the jxmlease
and yamlordereddictloader
Python modules
on the Junos proxy minion server under the same version of Python
that Salt is installed. For example:
saltuser@minion:~$ sudo pip3 install junos-eznc jxmlease yamlordereddictloader
After the dependencies are installed, restart the proxy minion process for that device on the proxy minion server and accept the new Salt key on the Salt master.