No description
- Go 93.5%
- Makefile 5.6%
- Shell 0.5%
- Dockerfile 0.4%
|
|
||
|---|---|---|
| .linter-config | ||
| dcimapiservice | ||
| docs/images | ||
| ipamapiservice | ||
| nbxclient | ||
| nbxtool | ||
| sysinfo | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .pre-commit-config.yaml | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| gonetbox-delay.sh | ||
| main.go | ||
| Makefile | ||
| netbox.yaml | ||
| README.md | ||
gonetbox
Client to create device in netbox server. To create new device name and ids of site, device role and device type are needed.
How to use
Options
| Option | Description | Type | Default | Required? |
|---|---|---|---|---|
--show-device |
Print device info | bool |
false | No |
--interfaces |
Create or update interfaces in netbox | bool |
false | No |
--ips |
Create or update ips for interfaces in netbox | bool |
false | No |
--connections |
Create or update connections between interfaces in netbox | bool |
false | No |
Hostname exaple: mdb1-prt-cp2
| mdb1 | prt | cp2 |
|---|---|---|
| site part | dev role part |
site part
Get site from hostname
1:1(mdb1:mdb1) match
if ffm*(ffm1:ntt) match ntt site
else match undefined site
Sites in netbox.onmetal.sk
lab
mdb1
mdb2
mdb3
ntt
undefined
device role part
Get device role from hostname
Possible roles in devicename from hardware list
- [X] COMP -> Compute
- [X] EDGE1/2 -> Networking
- [X] MGMT0 -> Partition
- [X] ZERO -> Partition
- [X] OOB -> Networking
- [X] PART1/2/3 -> Partition
- [X] REGN1/2 -> Region
- [X] ROUTER1/2 -> Router
- [X] SPINE1/2 -> Networking
- [X] STOR -> Storage
- [X] SONIC1/2/3 -> Netwoking
Device roles in netbox.onmetal.sk
Compute
Networking
Partition
Region
Router
Storage
undefined
Development
Copy repo:
git clone https://gitlab.devops.telekom.de/cas-devs/osc/onmetal/gonetbox.git
Create new branch, make changes, and push to remote repo. Tagging commit will trigger pipeline. Pipeline will build and push new container image to mtr repo in image format: gonetbox:<tag>
Local build
Help:
make help
Build binary:
make build-amd
make build-arm
Image
Prerequisites:
docker
install for macos:
brew install --cast docker
Log in to mtr.devops.telekom.de
docker login -u="<username>" -p="<password>" mtr.devops.telekom.de
Build image:
make image-build
Push image:
make image-push