-
Notifications
You must be signed in to change notification settings - Fork 45
Salt Grains for matching port descriptions and configuration on top of it #260
Comments
response from @mirceaulinic
I see what you are trying to achieve @icmp-echo. Searching for a particular detail indeed is very useful in production networks especially when it grows that much that you can't keep in mind all the details.
As an aside, check this out too: https://docs.saltstack.com/en/develop/ref/runners/all/salt.runners.bgp.html. You can also use the grains to achieve this, but I would not recommend. Salt impresses with its speed and caching the interfaces under grains would slow down a bit the matching if you have a device with many interfaces. Grains should have a very simple structure. But if you really want, you can, by writing a custom grains modules in your envirnment: https://docs.saltstack.com/en/develop/topics/grains/index.html#writing-grains def interfaces_grain(proxy):
if proxy['napalm.initialized']:
intrf = proxy['napalm.call']('get_interfaces')
if intrf:
return {'interfaces_details': intrf.get('out', {})} And then you can select your devices like: |
@mirceaulinic Hey sir, when salt nitrogen will get released? and how to install net.find runner ? |
@icmp-echo I don't know exactly when Salt Nitrogen will be released - it has been tagged as The Till the official release, you can take it from: https://github.com/napalm-automation/napalm-salt/blob/master/nitrogen/_runners/net.py (copy from there, paste it in a directory called I believe this is not the right place for Salt-related questions so I am going to close this issue & feel free to reopen under https://github.com/napalm-automation/napalm-salt. |
Creating a new issue to follow up with issue #197
salt -G 'os:junos and interface:fe-0/0/5' grains.get description
The text was updated successfully, but these errors were encountered: