mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 11:26:26 -06:00
Add initializers to produce a single 6 wedge site with 9U lockers
This commit is contained in:
parent
67cc069857
commit
cb72054a1a
@ -1,15 +1,9 @@
|
|||||||
# - name: switch
|
- name: Access Switch
|
||||||
# slug: switch
|
slug: access-switch
|
||||||
# color: Grey
|
color: pink
|
||||||
# - name: router
|
- name: Customer Compute Locker
|
||||||
# slug: router
|
slug: customer-compute-locker
|
||||||
# color: Cyan
|
color: Light grey
|
||||||
# - name: load-balancer
|
- name: Customer Network Locker
|
||||||
# slug: load-balancer
|
slug: customer-network-locker
|
||||||
# color: Red
|
color: Dark grey
|
||||||
# - name: server
|
|
||||||
# slug: server
|
|
||||||
# color: Blue
|
|
||||||
# - name: patchpanel
|
|
||||||
# slug: patchpanel
|
|
||||||
# color: Black
|
|
||||||
|
@ -1,23 +1,25 @@
|
|||||||
# - model: Model 1
|
- is_full_depth: 'True'
|
||||||
# manufacturer: Manufacturer 1
|
manufacturer: ASRock Inc.
|
||||||
# slug: model-1
|
model: IMB-1213
|
||||||
# u_height: 2
|
slug: asrock-imb-1213
|
||||||
# custom_fields:
|
u_height: 0
|
||||||
# text_field: Description
|
- is_full_depth: 'True'
|
||||||
# - model: Model 2
|
manufacturer: Flex, LTD
|
||||||
# manufacturer: Manufacturer 1
|
model: 9U Locker
|
||||||
# slug: model-2
|
slug: 9u-locker
|
||||||
# custom_fields:
|
u_height: 9
|
||||||
# text_field: Description
|
- is_full_depth: 'True'
|
||||||
# - model: Model 3
|
manufacturer: Juniper Networks, Inc
|
||||||
# manufacturer: Manufacturer 1
|
model: QFX5120-48Y-8C
|
||||||
# slug: model-3
|
slug: qfx5120-48y-8c
|
||||||
# is_full_depth: false
|
u_height: 1
|
||||||
# u_height: 0
|
- manufacturer: Vapor, IO
|
||||||
# custom_fields:
|
model: VEC Cartridge Rev 3.0
|
||||||
# text_field: Description
|
part_number: '700747'
|
||||||
# - model: Other
|
slug: vec-cart-v3
|
||||||
# manufacturer: NoName
|
u_height: 0
|
||||||
# slug: other
|
- manufacturer: Vapor, IO
|
||||||
# custom_fields:
|
model: VEC Sled v2
|
||||||
# text_field: Description
|
slug: vec-sled-v2
|
||||||
|
subdevice_role: True
|
||||||
|
u_height: 1
|
||||||
|
@ -1,27 +1,267 @@
|
|||||||
# - name: server01
|
- device_role: Access Switch
|
||||||
# device_role: server
|
device_type: QFX5120-48Y-8C
|
||||||
# device_type: Other
|
name: EFR1.TEST0.GCP
|
||||||
# site: AMS 1
|
site: Test Site (TEST0.GCP)
|
||||||
# rack: rack-01
|
face: Front
|
||||||
# face: Front
|
- device_role: Access Switch
|
||||||
# position: 1
|
device_type: QFX5120-48Y-8C
|
||||||
# custom_fields:
|
name: EFR2.TEST0.GCP
|
||||||
# text_field: Description
|
face: Front
|
||||||
# - name: server02
|
site: Test Site (TEST0.GCP)
|
||||||
# device_role: server
|
|
||||||
# device_type: Other
|
|
||||||
# site: AMS 2
|
- device_role: Customer Compute Locker
|
||||||
# rack: rack-02
|
face: Front
|
||||||
# face: Front
|
device_type: 9U Locker
|
||||||
# position: 2
|
name: L1A.W1.TEST0.GCP
|
||||||
# custom_fields:
|
position: 1
|
||||||
# text_field: Description
|
rack: W1 Zone A
|
||||||
# - name: server03
|
site: Test Site (TEST0.GCP)
|
||||||
# device_role: server
|
- device_role: Customer Network Locker
|
||||||
# device_type: Other
|
face: Front
|
||||||
# site: SING 1
|
device_type: 9U Locker
|
||||||
# rack: rack-03
|
name: L1B.W1.TEST0.GCP
|
||||||
# face: Front
|
position: 1
|
||||||
# position: 3
|
rack: W1 Zone B
|
||||||
# custom_fields:
|
site: Test Site (TEST0.GCP)
|
||||||
# text_field: Description
|
|
||||||
|
|
||||||
|
- device_role: Customer Compute Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L2A.W1.TEST0.GCP
|
||||||
|
position: 10
|
||||||
|
rack: W1 Zone A
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
- device_role: Customer Network Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L2B.W1.TEST0.GCP
|
||||||
|
position: 10
|
||||||
|
rack: W1 Zone B
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
|
||||||
|
- device_role: Customer Compute Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L3A.W1.TEST0.GCP
|
||||||
|
position: 19
|
||||||
|
rack: W1 Zone A
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
- device_role: Customer Network Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L3B.W1.TEST0.GCP
|
||||||
|
position: 19
|
||||||
|
rack: W1 Zone B
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
|
||||||
|
- device_role: Customer Compute Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L4A.W1.TEST0.GCP
|
||||||
|
position: 28
|
||||||
|
rack: W1 Zone A
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
- device_role: Customer Network Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L4B.W1.TEST0.GCP
|
||||||
|
position: 28
|
||||||
|
rack: W1 Zone B
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
|
||||||
|
- device_role: Customer Compute Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L1A.W2.TEST0.GCP
|
||||||
|
position: 1
|
||||||
|
rack: W2 Zone A
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
- device_role: Customer Network Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L1B.W2.TEST0.GCP
|
||||||
|
position: 1
|
||||||
|
rack: W2 Zone B
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
|
||||||
|
- device_role: Customer Compute Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L2A.W2.TEST0.GCP
|
||||||
|
position: 10
|
||||||
|
rack: W2 Zone A
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
- device_role: Customer Network Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L2B.W2.TEST0.GCP
|
||||||
|
position: 10
|
||||||
|
rack: W2 Zone B
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
|
||||||
|
- device_role: Customer Compute Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L3A.W2.TEST0.GCP
|
||||||
|
position: 19
|
||||||
|
rack: W2 Zone A
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
- device_role: Customer Network Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L3B.W2.TEST0.GCP
|
||||||
|
position: 19
|
||||||
|
rack: W2 Zone B
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
|
||||||
|
- device_role: Customer Compute Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L4A.W2.TEST0.GCP
|
||||||
|
position: 28
|
||||||
|
rack: W2 Zone A
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
- device_role: Customer Network Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L4B.W2.TEST0.GCP
|
||||||
|
position: 28
|
||||||
|
rack: W2 Zone B
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
|
||||||
|
- device_role: Customer Compute Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L1A.W3.TEST0.GCP
|
||||||
|
position: 1
|
||||||
|
rack: W3 Zone A
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
- device_role: Customer Network Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L1B.W3.TEST0.GCP
|
||||||
|
position: 1
|
||||||
|
rack: W3 Zone B
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
|
||||||
|
- device_role: Customer Compute Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L2A.W3.TEST0.GCP
|
||||||
|
position: 10
|
||||||
|
rack: W3 Zone A
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
- device_role: Customer Network Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L2B.W3.TEST0.GCP
|
||||||
|
position: 10
|
||||||
|
rack: W3 Zone B
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
|
||||||
|
- device_role: Customer Compute Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L3A.W3.TEST0.GCP
|
||||||
|
position: 19
|
||||||
|
rack: W3 Zone A
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
- device_role: Customer Network Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L3B.W3.TEST0.GCP
|
||||||
|
position: 19
|
||||||
|
rack: W3 Zone B
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
|
||||||
|
- device_role: Customer Compute Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L4A.W3.TEST0.GCP
|
||||||
|
position: 28
|
||||||
|
rack: W3 Zone A
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
- device_role: Customer Network Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L4B.W3.TEST0.GCP
|
||||||
|
position: 28
|
||||||
|
rack: W3 Zone B
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
|
||||||
|
- device_role: Customer Compute Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L1A.W4.TEST0.GCP
|
||||||
|
position: 1
|
||||||
|
rack: W4 Zone A
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
- device_role: Customer Network Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L1B.W4.TEST0.GCP
|
||||||
|
position: 1
|
||||||
|
rack: W4 Zone B
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
|
||||||
|
- device_role: Customer Compute Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L2A.W4.TEST0.GCP
|
||||||
|
position: 10
|
||||||
|
rack: W4 Zone A
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
- device_role: Customer Network Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L2B.W4.TEST0.GCP
|
||||||
|
position: 10
|
||||||
|
rack: W4 Zone B
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
|
||||||
|
- device_role: Customer Compute Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L3A.W4.TEST0.GCP
|
||||||
|
position: 19
|
||||||
|
rack: W4 Zone A
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
- device_role: Customer Network Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L3B.W4.TEST0.GCP
|
||||||
|
position: 19
|
||||||
|
rack: W4 Zone B
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
|
||||||
|
- device_role: Customer Compute Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L4A.W4.TEST0.GCP
|
||||||
|
position: 28
|
||||||
|
rack: W4 Zone A
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
- device_role: Customer Network Locker
|
||||||
|
face: Front
|
||||||
|
device_type: 9U Locker
|
||||||
|
name: L4B.W4.TEST0.GCP
|
||||||
|
position: 28
|
||||||
|
rack: W4 Zone B
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
@ -1,6 +1,18 @@
|
|||||||
# - name: Manufacturer 1
|
- name: ASRock Inc.
|
||||||
# slug: manufacturer-1
|
slug: asrock-inc
|
||||||
# - name: Manufacturer 2
|
- name: BasX
|
||||||
# slug: manufacturer-2
|
slug: basx
|
||||||
# - name: NoName
|
- name: Eaton
|
||||||
# slug: noname
|
slug: eaton
|
||||||
|
- name: eGauge Systems, LLC
|
||||||
|
slug: egauge-systems-llc
|
||||||
|
- name: Flex, LTD
|
||||||
|
slug: flex-ltd
|
||||||
|
- name: HID Global Corporation
|
||||||
|
slug: hid-global-corporation
|
||||||
|
- name: Juniper Networks, Inc
|
||||||
|
slug: juniper-networks-inc
|
||||||
|
- name: Ubiquiti Networks, Inc
|
||||||
|
slug: ubiquiti-networks-inc
|
||||||
|
- name: Vapor, IO
|
||||||
|
slug: vapor
|
||||||
|
18
docker/initializers/rack_groups.yml
Normal file
18
docker/initializers/rack_groups.yml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
- name: Rack 1
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
slug: w1-c1-test0-gcp
|
||||||
|
- name: Rack 2
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
slug: w2-c1-test0-gcp
|
||||||
|
- name: Rack 3
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
slug: w3-c1-test0-gcp
|
||||||
|
- name: Rack 4
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
slug: w4-c1-test0-gcp
|
||||||
|
- name: Rack 5
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
slug: w5-c1-test0-gcp
|
||||||
|
- name: Rack 6
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
slug: w6-c1-test0-gcp
|
@ -1,12 +1,9 @@
|
|||||||
# - name: Role 1
|
- color: 8bc34a
|
||||||
# slug: role-1
|
name: Customer
|
||||||
# color: Pink
|
slug: customer
|
||||||
# - name: Role 2
|
- color: 2196f3
|
||||||
# slug: role-2
|
name: Facility
|
||||||
# color: Cyan
|
slug: facility
|
||||||
# - name: Role 3
|
- color: ff5722
|
||||||
# slug: role-3
|
name: Utility
|
||||||
# color: Grey
|
slug: utility
|
||||||
# - name: Role 4
|
|
||||||
# slug: role-4
|
|
||||||
# color: Teal
|
|
||||||
|
@ -1,24 +1,157 @@
|
|||||||
# - site: AMS 1
|
- facility_id: f.w1.c1.test0.gcp
|
||||||
# name: rack-01
|
group: Rack 1
|
||||||
# role: Role 1
|
name: W1 Facility
|
||||||
# type: 4-post cabinet
|
role: Facility
|
||||||
# width: 19 inches
|
site: Test Site (TEST0.GCP)
|
||||||
# u_height: 47
|
type: 4-post cabinet
|
||||||
# custom_fields:
|
u_height: '36'
|
||||||
# text_field: Description
|
width: '19'
|
||||||
# - site: AMS 2
|
- facility_id: a.w1.c1.test0.gcp
|
||||||
# name: rack-02
|
group: Rack 1
|
||||||
# role: Role 2
|
name: W1 Zone A
|
||||||
# type: 4-post cabinet
|
role: Customer
|
||||||
# width: 19 inches
|
site: Test Site (TEST0.GCP)
|
||||||
# u_height: 47
|
type: 4-post cabinet
|
||||||
# custom_fields:
|
u_height: '36'
|
||||||
# text_field: Description
|
width: '19'
|
||||||
# - site: SING 1
|
- facility_id: b.w1.c1.test0.gcp
|
||||||
# name: rack-03
|
group: Rack 1
|
||||||
# role: Role 3
|
name: W1 Zone B
|
||||||
# type: 4-post cabinet
|
role: Utility
|
||||||
# width: 19 inches
|
site: Test Site (TEST0.GCP)
|
||||||
# u_height: 47
|
type: 4-post cabinet
|
||||||
# custom_fields:
|
u_height: '36'
|
||||||
# text_field: Description
|
width: '19'
|
||||||
|
|
||||||
|
|
||||||
|
- facility_id: f.w2.c1.test0.gcp
|
||||||
|
group: Rack 2
|
||||||
|
name: W2 Facility
|
||||||
|
role: Facility
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
type: 4-post cabinet
|
||||||
|
u_height: '36'
|
||||||
|
width: '19'
|
||||||
|
- facility_id: a.w2.c1.test0.gcp
|
||||||
|
group: Rack 2
|
||||||
|
name: W2 Zone A
|
||||||
|
role: Customer
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
type: 4-post cabinet
|
||||||
|
u_height: '36'
|
||||||
|
width: '19'
|
||||||
|
- facility_id: b.w2.c1.test0.gcp
|
||||||
|
group: Rack 2
|
||||||
|
name: W2 Zone B
|
||||||
|
role: Utility
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
type: 4-post cabinet
|
||||||
|
u_height: '36'
|
||||||
|
width: '19'
|
||||||
|
|
||||||
|
|
||||||
|
- facility_id: f.w3.c1.test0.gcp
|
||||||
|
group: Rack 3
|
||||||
|
name: W3 Facility
|
||||||
|
role: Facility
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
type: 4-post cabinet
|
||||||
|
u_height: '36'
|
||||||
|
width: '19'
|
||||||
|
- facility_id: a.w3.c1.test0.gcp
|
||||||
|
group: Rack 3
|
||||||
|
name: W3 Zone A
|
||||||
|
role: Customer
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
type: 4-post cabinet
|
||||||
|
u_height: '36'
|
||||||
|
width: '19'
|
||||||
|
- facility_id: b.w3.c1.test0.gcp
|
||||||
|
group: Rack 3
|
||||||
|
name: W3 Zone B
|
||||||
|
role: Utility
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
type: 4-post cabinet
|
||||||
|
u_height: '36'
|
||||||
|
width: '19'
|
||||||
|
|
||||||
|
|
||||||
|
- facility_id: f.w4.c1.test0.gcp
|
||||||
|
group: Rack 4
|
||||||
|
name: W4 Facility
|
||||||
|
role: Facility
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
type: 4-post cabinet
|
||||||
|
u_height: '36'
|
||||||
|
width: '19'
|
||||||
|
- facility_id: a.w4.c1.test0.gcp
|
||||||
|
group: Rack 4
|
||||||
|
name: W4 Zone A
|
||||||
|
role: Customer
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
type: 4-post cabinet
|
||||||
|
u_height: '36'
|
||||||
|
width: '19'
|
||||||
|
- facility_id: b.w4.c1.test0.gcp
|
||||||
|
group: Rack 4
|
||||||
|
name: W4 Zone B
|
||||||
|
role: Utility
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
type: 4-post cabinet
|
||||||
|
u_height: '36'
|
||||||
|
width: '19'
|
||||||
|
|
||||||
|
|
||||||
|
- facility_id: f.w5.c1.test0.gcp
|
||||||
|
group: Rack 5
|
||||||
|
name: W5 Facility
|
||||||
|
role: Facility
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
type: 4-post cabinet
|
||||||
|
u_height: '36'
|
||||||
|
width: '19'
|
||||||
|
- facility_id: a.w5.c1.test0.gcp
|
||||||
|
group: Rack 5
|
||||||
|
name: W5 Zone A
|
||||||
|
role: Customer
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
|
||||||
|
type: 4-post cabinet
|
||||||
|
u_height: '36'
|
||||||
|
width: '19'
|
||||||
|
- facility_id: b.w5.c1.test0.gcp
|
||||||
|
group: Rack 5
|
||||||
|
name: W5 Zone B
|
||||||
|
role: Utility
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
type: 4-post cabinet
|
||||||
|
u_height: '36'
|
||||||
|
width: '19'
|
||||||
|
|
||||||
|
|
||||||
|
- facility_id: f.w6.c1.test0.gcp
|
||||||
|
group: Rack 6
|
||||||
|
name: W6 Facility
|
||||||
|
role: Facility
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
type: 4-post cabinet
|
||||||
|
u_height: '36'
|
||||||
|
width: '19'
|
||||||
|
- facility_id: a.w6.c1.test0.gcp
|
||||||
|
group: Rack 6
|
||||||
|
name: W6 Zone A
|
||||||
|
role: Customer
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
type: 4-post cabinet
|
||||||
|
u_height: '36'
|
||||||
|
width: '19'
|
||||||
|
- facility_id: b.w6.c1.test0.gcp
|
||||||
|
group: Rack 6
|
||||||
|
name: W6 Zone B
|
||||||
|
role: Utility
|
||||||
|
site: Test Site (TEST0.GCP)
|
||||||
|
type: 4-post cabinet
|
||||||
|
u_height: '36'
|
||||||
|
width: '19'
|
||||||
|
@ -1,10 +1,2 @@
|
|||||||
# - name: Singapore
|
- name: GCP
|
||||||
# slug: singapore
|
slug: gcp
|
||||||
# - name: Amsterdam
|
|
||||||
# slug: amsterdam
|
|
||||||
# - name: Downtown
|
|
||||||
# slug: downtown
|
|
||||||
# parent: Amsterdam
|
|
||||||
# - name: Suburbs
|
|
||||||
# slug: suburbs
|
|
||||||
# parent: Amsterdam
|
|
||||||
|
@ -1,32 +1,5 @@
|
|||||||
# - name: AMS 1
|
- name: Test Site (TEST0.GCP)
|
||||||
# slug: ams1
|
slug: test0-gcp
|
||||||
# region: Downtown
|
region: GCP
|
||||||
# status: 1
|
status: 1
|
||||||
# facility: Amsterdam 1
|
facility: us-central1
|
||||||
# asn: 12345
|
|
||||||
# custom_fields:
|
|
||||||
# text_field: Description
|
|
||||||
# - name: AMS 2
|
|
||||||
# slug: ams2
|
|
||||||
# region: Downtown
|
|
||||||
# status: 1
|
|
||||||
# facility: Amsterdam 2
|
|
||||||
# asn: 54321
|
|
||||||
# custom_fields:
|
|
||||||
# text_field: Description
|
|
||||||
# - name: AMS 3
|
|
||||||
# slug: ams3
|
|
||||||
# region: Suburbs
|
|
||||||
# status: 1
|
|
||||||
# facility: Amsterdam 3
|
|
||||||
# asn: 67890
|
|
||||||
# custom_fields:
|
|
||||||
# text_field: Description
|
|
||||||
# - name: SING 1
|
|
||||||
# slug: sing1
|
|
||||||
# region: Singapore
|
|
||||||
# status: 1
|
|
||||||
# facility: Singapore 1
|
|
||||||
# asn: 09876
|
|
||||||
# custom_fields:
|
|
||||||
# text_field: Description
|
|
||||||
|
31
docker/startup_scripts/071_rack_groups.py
Normal file
31
docker/startup_scripts/071_rack_groups.py
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
from dcim.models import Site, RackGroup
|
||||||
|
from ruamel.yaml import YAML
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
import sys
|
||||||
|
|
||||||
|
file = Path('/opt/netbox/initializers/rack_groups.yml')
|
||||||
|
if not file.is_file():
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
with file.open('r') as stream:
|
||||||
|
yaml=YAML(typ='safe')
|
||||||
|
rack_groups = yaml.load(stream)
|
||||||
|
|
||||||
|
required_assocs = {
|
||||||
|
'site': (Site, 'name')
|
||||||
|
}
|
||||||
|
|
||||||
|
if rack_groups is not None:
|
||||||
|
for params in rack_groups:
|
||||||
|
|
||||||
|
for assoc, details in required_assocs.items():
|
||||||
|
model, field = details
|
||||||
|
query = { field: params.pop(assoc) }
|
||||||
|
|
||||||
|
params[assoc] = model.objects.get(**query)
|
||||||
|
|
||||||
|
rack_group, created = RackGroup.objects.get_or_create(**params)
|
||||||
|
|
||||||
|
if created:
|
||||||
|
print("👪 Created rack group", rack_group.name)
|
28
scripts/export-to-initializers
Executable file
28
scripts/export-to-initializers
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import os
|
||||||
|
import csv
|
||||||
|
import sys
|
||||||
|
import yaml
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(description='Netbox csv export to initializer yaml')
|
||||||
|
parser.add_argument(
|
||||||
|
'input',
|
||||||
|
type=argparse.FileType('r'),
|
||||||
|
metavar='export.csv',
|
||||||
|
help='netbox csv export'
|
||||||
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
'output',
|
||||||
|
type=argparse.FileType('w'),
|
||||||
|
help='parsed yaml output'
|
||||||
|
)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
data = [r for r in csv.reader(args.input)]
|
||||||
|
header = data.pop(0)
|
||||||
|
output = [dict(zip(header, r)) for r in data]
|
||||||
|
args.output.write(yaml.dump(output, default_flow_style=False))
|
Loading…
Reference in New Issue
Block a user