Skip to main content

PyPI version Python 3.6 Python 3.7 Python 3.8 Code Style

nornir ansible

Ansible Inventory plugin for nornir.

Install

In most cases installation via pip is the simplest and best way to install nornir_ansible.

pip install nornir_ansible

Basic Example

In your nornir configuration, set the inventory plugin value to AnsibleInventory

---
inventory:
  plugin: AnsibleInventory
  options:
    hostsfile: "inventory.yaml"

The hostsfile inventory option argument should point to a valid Ansible inventory file, in this case a yaml style inventory such as:

---
all:
  vars:
    ansible_python_interpreter: "/usr/bin/python3"
    username: "vrnetlab"
    password: "VR-netlab9"
  children:
    sea:
      hosts:
        sea-eos-1:
          ansible_host: "172.18.0.14"
        sea-nxos-1:
          ansible_host: "172.18.0.12"
      children:
        arista-eos:
          hosts:
            sea-eos-1:
          vars:
            platform: "eos"
        cisco-nxos:
          hosts:
            sea-nxos-1:
          vars:
            platform: "nxos"

Initialize your nornir object and validate the appropriate inventory plugin was loaded, and the inventory file was parsed:

>>> from nornir import InitNornir
>>> nr = InitNornir(config_file="config.yaml")
>>> print(nr.config.inventory.plugin)
<class 'nornir_ansible.plugins.inventory.ansible.AnsibleInventory'>
>>> print(nr.inventory.hosts)
{'sea-eos-1': Host: sea-eos-1, 'sea-nxos-1': Host: sea-nxos-1}
>>>

Useful Links

Metadata

Release files for nornir-ansible 2023.12.28

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nornir-ansible 2023.12.28
File Size Uploaded Provenance Actions
nornir_ansible-2023.12.28.tar.gz 12.8 kB Without provenance Details for nornir_ansible-2023.12.28.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nornir-ansible 2023.12.28
File Interpreter ABI Platform Actions
nornir_ansible-2023.12.28-py3-none-any.whl Python 3 none any Details for nornir_ansible-2023.12.28-py3-none-any.whl

Total release size: 25.0 kB

Release files / nornir_ansible-2023.12.28.tar.gz

Download URL nornir_ansible-2023.12.28.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c04166b2a8584fcdcc592a010530757c64b414eacc98b15efae8c5ccf69a5230
BLAKE2b-256 checksum
How to use checksums
37a3eb3d3a8d4f15e3cd4a618e622a7ebda8b44ffdddebf371326ecbf7a94943
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / nornir_ansible-2023.12.28-py3-none-any.whl

Download URL nornir_ansible-2023.12.28-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1cc6b17880e66413607b953277a9659e1b98fcc7a5b767e6e1b7583b1244c031
BLAKE2b-256 checksum
How to use checksums
3f8ec870d370c0b4d391f3aab2f6bf5242b0a636cea99764e5db56a7dfb2cf20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Security for nornir-ansible 2023.12.28

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page