Categories

Category cover

Automation
155 posts

Category cover

Learning paths
119 posts

Category cover

CISO
22 posts

Category cover

Security
20 posts

Category cover

Notes
19 posts

Category cover

Personal Security
18 posts

Category cover

Infrastructure
12 posts

Category cover

OT/ICS
5 posts

Category cover

Books
3 posts

Category cover

UNetLab
3 posts

Category cover

Write-up
3 posts

Category cover

OSInt
2 posts

Category cover

My life
1 posts

Key insights from developing Nautobot and Ansible integrations

Andrea Dainese
July 12, 2024
Post cover

Beyond the topics discussed in previous posts, my work on this project focused on four key areas: The data structure of Nautobot Nautobot’s

Beyond the topics discussed in previous posts, my work on this project focused on four key areas:

  • The data structure of Nautobot
  • Nautobot’s REST API
  • Integrating Ansible with Nautobot
  • Running Ansible playbooks from Nautobot

Let’s dive into the challenges encountered and the solutions omitted from previous posts.

Nautobot’s data structure

Effectively using Nautobot requires careful planning of the data structure to avoid costly changes later. Understanding this structure allows for simplifications in automation scripts.

Each object in Nautobot is identified by a UUID, such as 2170a207-43b2-422a-a90d-51a4908b85fb. This choice allows any attribute to be changed without issues. Since the device identifier is a UUID and not a name, we must consider:

  • Can two devices have the same name?
  • Can two interfaces on the same device have the same name?

Quick tests reveal that the answer is no to both questions, allowing for safe simplifications in automation scripts.

Django shell

Nautobot is built on Django , a Python-based web application framework. Django provides a shell for easy interaction with the data structure.

The decision had to be made whether to develop automations using the shell or the REST API.

The shell can be invoked using the command:

nautobot-server shell

Continue reading the post on Patreon .