aboutsummaryrefslogtreecommitdiffstats
path: root/tools/netbox/scripts/testdata.tf
diff options
context:
space:
mode:
authorSjur Fredriksen <sjurtf@ifi.uio.no>2025-04-22 22:49:15 +0200
committerSjur Fredriksen <sjurtf@ifi.uio.no>2025-04-22 22:49:39 +0200
commitd98b28fb005d6c379299175a3aedc15f56cfa925 (patch)
tree45b5b3a702aad0a83a570b87ecc0758a3d4d0f80 /tools/netbox/scripts/testdata.tf
parent5aaf88e07130007016de778dce44f8ee88f01d56 (diff)
chore: dump tg25 templates/netconfig
Diffstat (limited to 'tools/netbox/scripts/testdata.tf')
-rwxr-xr-xtools/netbox/scripts/testdata.tf96
1 files changed, 96 insertions, 0 deletions
diff --git a/tools/netbox/scripts/testdata.tf b/tools/netbox/scripts/testdata.tf
new file mode 100755
index 0000000..42223d3
--- /dev/null
+++ b/tools/netbox/scripts/testdata.tf
@@ -0,0 +1,96 @@
+##
+## EX2200 and EX3300 device types must be added
+##
+##
+terraform {
+ required_providers {
+ netbox = {
+ source = "e-breuninger/netbox"
+ version = "~> 3.2.1"
+ }
+ }
+}
+
+# example provider configuration for https://demo.netbox.dev
+provider "netbox" {
+ server_url = "http://localhost:8000"
+ api_token = "14ef292da3c0564c591cd39eb22fa2cbab75b141"
+}
+
+resource "netbox_manufacturer" "juniper" {
+ name = "Juniper"
+}
+
+resource "netbox_site" "site" {
+ name = "Vikingskipet"
+}
+
+resource "netbox_location" "loc" {
+ name = "Ringen"
+ site_id = netbox_site.site.id
+}
+
+resource "netbox_device_role" "access" {
+ color_hex = "ff5722"
+ name = "Access switch"
+ slug = "access-switch"
+}
+resource "netbox_device_role" "leaf" {
+ color_hex = "ff5722"
+ name = "Leaf"
+ slug = "leaf"
+}
+resource "netbox_device_role" "distro" {
+ color_hex = "ff5722"
+ name = "Distro"
+ slug = "distro"
+}
+resource "netbox_device_role" "utskutt_distro" {
+ color_hex = "ff5722"
+ name = "Utskutt Distro"
+ slug = "utskutt-distro"
+}
+
+resource "netbox_ipam_role" "clients" {
+ name = "Clients"
+}
+
+resource "netbox_vrf" "clients" {
+ name = "CLIENTS"
+}
+
+resource "netbox_vlan_group" "fabric" {
+ max_vid = 10
+ min_vid = 400
+ name = "client-vlans"
+ slug = "client-vlans"
+}
+
+resource "netbox_vlan" "mgmt" {
+ name = "juniper-mgmt"
+ vid = 10
+}
+
+resource "netbox_prefix" "fabric_v4" {
+ prefix = "10.25.0.0/16"
+ status = "container"
+ description = "Fabric v4 clients"
+}
+
+resource "netbox_prefix" "fabric_v6" {
+ prefix = "2a06:5844:e::/48"
+ status = "container"
+ description = "Fabric v6 clients"
+}
+
+resource "netbox_prefix" "mgmt_v4" {
+ prefix = "185.110.149.0/25"
+ status = "active"
+ vlan_id = netbox_vlan.mgmt.id
+}
+
+resource "netbox_prefix" "mgmt_v6" {
+ prefix = "2a06:5841:f::/64"
+ status = "active"
+ vlan_id = netbox_vlan.mgmt.id
+}