Coder Social home page Coder Social logo

nautobot-fetch's Introduction

Nautobot as AVD Source of Truth

This project is meant to provide a modeling convention for Networktocode's Nautobot application as well as ansible roles to retrieve Nautobot data and render it into a yaml data model which can be consumed by Arista's ansible.avd collection to build a l3ls EVPN-VXLAN fabric.

Modeling Conventions

The modeling conventions are described in a separate document included in this repo.

Repository Contents

Ansible Roles

The included roles are described briefly here, refer to the individual role README file for more information.

nautobot-sync

This ansible role simply posts graphql queries to Nautobot and registers the returned results to variables so it can be used by the avdbuilder role.

avdbuilder

This ansible role uses the data fetched by nautobot-sync to render yaml files which can be used as group_vars for an AVD fabric.

Custom Filters

The emil.nbavd.structure_tenants filter is included in this repository and is required for the avdbuilder role to run.

Example Playbook

---
- hosts: nautobot
  connection: local
  gather_facts: false
  tasks:
    - name: Run nautobot-sync
      import_role:
        name: nautobot-sync

- hosts: nautobot
  tasks:
    - name: Run avdbuilder
      import_role:
        name: avdbuilder
      vars:
        fabric_name: TEST-FABRIC
        site_names: ["DC1", "DC2"]

Example Inventory

---
all:
  children:
    NAUTOBOT:
      hosts:
        nautobot:
          ansible_host: 10.10.10.10
          api_token: "<your api-token here>"

Requirements and Dependencies

Ansible

These roles have been tested with ansible-core 2.12.0.

AVD

Although the roles provided in this repository are not dependent on AVD, their output is fairly useless without it. The recommendation is to install via ansible galaxy:

ansible-galaxy collection install arista.avd

The roles are meant to work with the AVD version 3.x data model.

Nautobot Version

The roles have been tested with nautobot==v1.1.2

The custom fields that have been outlined in the modeling conventions doc need to be present, or the graphql queries posted by the nautobot-sync role will fail. It has been observed that sometimes a nautobot restart is required before the custom fields become available in the graphql API.

Additional Collections/Modules

Python Packages

pynautobot is required

Ansible Collections

networktocode.nautobot is required for grabbing custom configuration contexts via the API (not available through graphql API at the moment)

ansible-galaxy collection install networktocode.nautobot

nautobot-fetch's People

Contributors

emilarista avatar andreas1o avatar wezterlund avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

andreas1o

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.