nornir-automation / nornir

Pluggable multi-threaded framework with inventory management to help operate collections of devices
https://nornir.readthedocs.io/
Apache License 2.0
1.38k stars 234 forks source link

Run nornir without config file #798

Closed Sivolen closed 2 years ago

Sivolen commented 2 years ago

Hi!

Please help me, how to run nornir without config file I created dict

        host = {
                  "name": "core",
                  "connection_options": {},
                  "hostname": "10.255.100.1",
                  "port": 22,
                  # "username": null,
                  # "password": null,
                  "platform": "ce"
nr_driver = InitNornir(inventory=host, logging=self.logging_file)

but it doesn't work if i use next dict he also doesn't' work

inventory_cfg = {'yzh-krm24-cr420-r01': {'connection_options': {},
                                   'data': {
                                   'hostname': '10.255.100.81',
                                   'name': 'yzh-krm24-cr420-r01',
                                   'password': None,
                                   'platform': 'ce',
                                   'port': None,
                                   'username': None}}}}
nr_driver = InitNornir(inventory=inventory_cfg, logging=self.logging_file)