Comments (6)
Hi @wdennis,
It's technically possible. All that function needs to return is the nr object. You could write a second function named get_nb_nr()
and make sure it returns the object in the similar way.
I haven't used the netbox inventory plugin before, so perhaps you could share some code or an example?
from net-api.
Hi @wdennis,
Just following up on whether you wanted to share some code so I can take a look?
from net-api.
@writememe Sorry for late reply, been busy + holiday time here...
</excuse>
Example of my InitNornir invocation and the associated config file:
nr = InitNornir(
config_file="config_nb_network_switches.yaml",
dry_run=False,
)
nr.inventory.defaults.username = "superuser"
nr.inventory.defaults.password = "5uper53cre7"
config_nb_network_switches.yaml:
---
core:
num_workers: 20
inventory:
plugin: nornir.plugins.inventory.netbox.NBInventory
options:
nb_url: "http://netbox.mycompany.com"
nb_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
use_slugs: True
flatten_custom_fields: True
filter_parameters:
'role': ["core-switch", "distribution-switch", "access-switch", "transit-switch", "management-switch"]
This against Nornir 2.4.0; please note that the impending Nornir 3.0.0 will change things in regards to both the way plugins works, as well as the Netbox inventory plugin itself -- see:
- nornir-automation/nornir#486
- https://nornir.readthedocs.io/en/3.0.0/upgrading/2_to_3.html
- https://github.com/wvandeun/nornir_netbox/blob/develop/README.md (see NetBoxInventory2 note)
from net-api.
Hi @wdennis all good mate, so am I :). I'm going to create a branch and work out what changes are needed to uplift the code to support nornir 3. When that's done and working, perhaps we can look at the new netbox plugin then?
from net-api.
from net-api.
Hi @wdennis, just finished the nornir 3 refactor now. If you pull the latest version of the code, you should be able to work from that now.
Haven't used netbox much to be honest, but I'm guessing it just need another get_nr
function similar to line 97:
Line 81 in ed69b15
With the netbox plugin in it? What are you thinking?
from net-api.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from net-api.