forked from goebelmeier/racktables2netbox
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from ITJamie/ci_testing2
added ci testing
- Loading branch information
Showing
31 changed files
with
345 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
on: | ||
push | ||
|
||
name: ci | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: docker-practice/actions-setup-docker@master | ||
- uses: actions/checkout@v3 | ||
- run: | | ||
set -x | ||
docker version | ||
ls -lah | ||
cd development | ||
docker-compose up -d | ||
sleep 5 | ||
docker-compose up -d | ||
- run: | | ||
set -x | ||
cd development | ||
docker-compose exec -T rt2nb_runner /opt/repo/development/rt2nb_runner_run_migration.sh | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_0u_device | ||
slug: generic_0u_device | ||
u_height: 0 | ||
is_full_depth: false |
12 changes: 12 additions & 0 deletions
12
custom_device_templates/generic/generic_0u_patch_panel.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_0u_patch_panel | ||
slug: generic_0u_patch_panel | ||
u_height: 0 | ||
is_full_depth: false | ||
subdevice_role: parent | ||
device-bays: | ||
- name: '01' | ||
- name: '02' | ||
- name: '03' | ||
- name: '04' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_10u_device | ||
slug: generic_10u_device | ||
u_height: 10 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_12u_device | ||
slug: generic_12u_device | ||
u_height: 12 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_18u_device | ||
slug: generic_18u_device | ||
u_height: 18 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_1u_device | ||
slug: generic_1u_device | ||
u_height: 1 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
12 changes: 12 additions & 0 deletions
12
custom_device_templates/generic/generic_1u_patch_panel.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_1u_patch_panel | ||
slug: generic_1u_patch_panel | ||
u_height: 1 | ||
is_full_depth: false | ||
subdevice_role: parent | ||
device-bays: | ||
- name: '01' | ||
- name: '02' | ||
- name: '03' | ||
- name: '04' |
11 changes: 11 additions & 0 deletions
11
custom_device_templates/generic/generic_1u_short_device.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_1u_short_device | ||
slug: generic_1u_short_device | ||
u_height: 1 | ||
is_full_depth: false | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_22u_device | ||
slug: generic_22u_device | ||
u_height: 22 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_23u_device | ||
slug: generic_23u_device | ||
u_height: 23 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_24u_device | ||
slug: generic_24u_device | ||
u_height: 24 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_2u_device | ||
slug: generic_2u_device | ||
u_height: 2 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
11 changes: 11 additions & 0 deletions
11
custom_device_templates/generic/generic_2u_short_device.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_2u_short_device | ||
slug: generic_2u_short_device | ||
u_height: 2 | ||
is_full_depth: false | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_3u_device | ||
slug: generic_3u_device | ||
u_height: 3 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
11 changes: 11 additions & 0 deletions
11
custom_device_templates/generic/generic_3u_short_device.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_3u_short_device | ||
slug: generic_3u_short_device | ||
u_height: 3 | ||
is_full_depth: false | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_46u_device | ||
slug: generic_46u_device | ||
u_height: 46 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_48u_device | ||
slug: generic_48u_device | ||
u_height: 48 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_4u_device | ||
slug: generic_4u_device | ||
u_height: 4 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
11 changes: 11 additions & 0 deletions
11
custom_device_templates/generic/generic_4u_short_device.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_4u_short_device | ||
slug: generic_4u_short_device | ||
u_height: 4 | ||
is_full_depth: false | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_5u_device | ||
slug: generic_5u_device | ||
u_height: 5 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_6u_device | ||
slug: generic_6u_device | ||
u_height: 6 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_8u_device | ||
slug: generic_8u_device | ||
u_height: 8 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
manufacturer: Generic | ||
model: generic_9u_device | ||
slug: generic_9u_device | ||
u_height: 9 | ||
is_full_depth: true | ||
power-ports: | ||
- name: Power 1 | ||
type: iec-60320-c14 | ||
- name: Power 2 | ||
type: iec-60320-c14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from time import sleep | ||
import requests | ||
import os | ||
|
||
nb_not_up = True | ||
api_url = "http://netbox:8080/api" | ||
max_timeout_attempts = 20 | ||
current_attempts = 0 | ||
while nb_not_up: | ||
try: | ||
response = requests.get(api_url) | ||
print(f"status_code: {response.status_code}") | ||
if "circuits" in response.text: | ||
print("'circuits' in response. nb is up!") | ||
nb_not_up = False | ||
exit(0) | ||
except: | ||
print("did not get a repsonse yet") | ||
if not current_attempts < max_timeout_attempts: | ||
print("max attempts reached. dying") | ||
exit(2) | ||
if nb_not_up: | ||
print("netbox not yet up. sleeping for 10s and trying again") | ||
current_attempts = current_attempts + 1 | ||
sleep(10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
pip3 install -r /opt/repo/requirements.txt | ||
# pip3 install -r /opt/repo/requirements.txt | ||
tail -f /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
set -x | ||
pip3 install -r /opt/repo/requirements.txt | ||
|
||
cd /opt/repo/ | ||
|
||
python3 development/check_if_nb_api_up.py | ||
python3 rt2nb/racktables2netbox.py |
Oops, something went wrong.