Skip to main content

nornir_ipfabric plugin for nornir

Project description

Stars

LastCommit

Version

nornir_ipfabric

IPFabric Inventory plugin for nornir.

Install

The recommended way to install nornir_ipfabric is via pip

pip install nornir-ipfabric

Requirements

An instance of IP Fabric is required to collect information. Request trial license.

Example usage

Using env vars

Set environment vars to provide url and credentials to connect to the IP Fabric server

export IPF_URL=https://ipfabric.local
export IPF_USER=admin
export IPF_PASSWORD=mySecretPassword

If IP Fabric version 3.7 or above is in use, token authentication is available

export IPF_URL=https://ipfabric.local
export IPF_TOKEN=myToken
from nornir import InitNornir
nr = InitNornir(inventory={"plugin": "IPFabricInventory"})

Using the InitNornir function

Init with credentials

from nornir import InitNornir
nr = InitNornir(
    inventory=
        {
            "plugin": "IPFabricInventory", 
            "options": {
                "ipf_url":"https://ipfabric.local",
                "ipf_user":"admin",
                "ipf_password":"mySecretPassword",
                },
        },
    )

Init with token

from nornir import InitNornir
nr = InitNornir(
    inventory=
        {
            "plugin": "IPFabricInventory",
            "options": {
                "ipf_url":"https://ipfabric.local",
                "ipf_token":"myToken",
                },
        },
    )

Using the Nornir configuration file

File config.yaml with credendials

---
inventory:
  plugin: IPFInventory
  options:
    ipf_url: "https://ipfabric.local"
    ipf_user: "admin"
    ipf_password: "mySecretPassword"

File config.yaml with token

---
inventory:
  plugin: IPFInventory
  options:
    ipf_url: "https://ipfabric.local"
    ipf_token: "myToken"

Usage:

from nornir import InitNornir
nr = InitNornir(config_file="config.yaml",inventory={"plugin": "IPFabricInventory"})

Useful Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for nornir-ipfabric, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size nornir_ipfabric-0.1.4-py3.8.egg (8.9 kB) File type Egg Python version 3.8 Upload date Hashes View
Filename, size nornir_ipfabric-0.1.4-py3-none-any.whl (9.6 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page