Skip to content

feat(nautobotop): Add VLAN, Prefix, RIR, Role, and Tenancy sync support#1893

Open
abhimanyu003 wants to merge 5 commits intomainfrom
nautobotOpVlan
Open

feat(nautobotop): Add VLAN, Prefix, RIR, Role, and Tenancy sync support#1893
abhimanyu003 wants to merge 5 commits intomainfrom
nautobotOpVlan

Conversation

@abhimanyu003
Copy link
Copy Markdown
Contributor

Description:

This PR adds sync support for several new resource types.

  • Added imroc/req HTTP-Client with built-in retry and backoff to handle any API failure
  • Cache pre-loading was extended to cover all new resource types.

New syncs added:

  • VLAN
  • Prefix
  • RIR (Regional Internet Registry)
  • Role
  • Tenant Group
  • Tenant
  • VRF (lookup only)
  • Tag (lookup only)

The Nautobot API client was updated to use

Let me check if there are existing sample files for the other resource types too.

Now let me also check the models for VRF and Tag to show their structure:

Here are the sample YAMLs for all resource types:

VLAN:

- name: mgmt-vlan-100
  vid: 100
  status: Active
  role: Guest
  description: Management VLAN
  locations:
    - iad3
  vlan_group: management-vlans
  tenant_group: infrastructure
  tenant: network-ops
  dynamic_groups:
    - all-switches
  tags:
    - production
    - managed

Prefix:

- prefix: "10.0.0.0/8"
  namespace: Global
  type: container
  status: Active
  role: Infrastructure
  rir: "RFC 1918"
  date_allocated: "2024-01-15 10:30:00"
  description: Private address space
  vrfs:
    - management-vrf
  locations:
    - iad3
    - dfw1
  vlan_group: management-vlans
  vlan: mgmt-vlan-100
  tenant_group: infrastructure
  tenant: network-ops
  tags:
    - production

RIR:

- name: "RFC 1918"
  is_private: true
  description: Private IPv4 address space
- name: ARIN
  is_private: false
  description: American Registry for Internet Numbers

Role:

- name: Management
  color: "0000ff"
  description: Management network role
  weight: 1000
  content_types:
    - "ipam.vlan"
    - "ipam.prefix"

Tenant Group:

- name: infrastructure
  description: Infrastructure services
  parent: ""
- name: customers
  description: Customer tenants
  parent: ""

Tenant:

- name: network-ops
  description: Network Operations team
  comments: Manages all network infrastructure
  tenant_group: infrastructure
  tags:
    - production
    - managed

Testing: Its done locally and found no-error on multiple reconcile loop, as well as no error on fresh nautobot setup using helm

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants