Skip to content

Commit e5f4b92

Browse files
authored
Merge pull request #68 from ryanmerolle/1.0.1
1.0.1
2 parents 32a897d + 7d80a1f commit e5f4b92

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+624
-195
lines changed

.devcontainer/Dockerfile-plugin_dev

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
ARG VARIANT=v3.2-2.1.0
1+
ARG NETBOX_VARIANT=v3.2
22

3-
FROM netboxcommunity/netbox:${VARIANT}
3+
FROM netboxcommunity/netbox:${NETBOX_VARIANT}
4+
5+
ARG NETBOX_INITIALIZERS_VARIANT=3.2.3
46

57
ARG DEBIAN_FRONTEND=noninteractive
68

79
# Install APT packages
10+
# hadolint ignore=DL3008
811
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
912
&& apt-get -y install --no-install-recommends curl git make openssh-client python3.10-dev sudo wget zsh \
1013
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
@@ -18,22 +21,26 @@ ARG USERNAME=vscode
1821
ARG USER_UID=1000
1922
ARG USER_GID=$USER_UID
2023

21-
RUN useradd -md /home/vscode -s /usr/bin/zsh -u $USER_UID $USERNAME \
24+
RUN useradd -l -md /home/vscode -s /usr/bin/zsh -u $USER_UID $USERNAME \
2225
&& usermod -aG sudo $USERNAME \
2326
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
2427
&& mkdir /opt/netbox/netbox/netbox-acls \
2528
&& chown $USERNAME:$USERNAME /opt/netbox /etc/netbox /opt/unit -R
2629

2730
USER $USERNAME
2831

32+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
2933
# Add oh my zsh
3034
RUN wget --quiet https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true
3135

3236
COPY .bashrc /home/vscode/.bashrc
3337
COPY .zshrc /home/vscode/.zshrc
3438

39+
RUN /opt/netbox/venv/bin/pip install --no-warn-script-location netbox-initializers==${NETBOX_INITIALIZERS_VARIANT}
40+
3541
WORKDIR /opt/netbox/netbox/netbox-acls
3642

43+
# hadolint ignore=DL3002
3744
USER root
3845

3946
COPY entrypoint-dev.sh /bin/entrypoint-dev.sh

.devcontainer/configuration/plugins.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
# See https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins
66

77
PLUGINS = [
8+
"netbox_initializers", # Loads demo data
89
"netbox_acls",
910
]
1011

11-
PLUGINS_CONFIG = {
12+
PLUGINS_CONFIG = { # type: ignore
13+
"netbox_initializers": {},
1214
"netbox_acls": {},
1315
}

.devcontainer/devcontainer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
"python.linting.banditPath": "/opt/netbox/venv/bin/bandit",
4545
"python.linting.enabled": true,
4646
"python.linting.flake8Path": "/opt/netbox/venv/bin/flake8",
47+
"python.linting.flake8Args": [
48+
"--max-line-length=160",
49+
"--ignore=E203"
50+
],
4751
"python.linting.mypyPath": "//opt/netbox/venv/bin/mypy",
4852
"python.linting.pycodestylePath": "/opt/netbox/venv/bin/pycodestyle",
4953
"python.linting.pydocstylePath": "/opt/netbox/venv/bin/pydocstyle",
@@ -57,6 +61,7 @@
5761
],
5862
"python.linting.pylintEnabled": true,
5963
"python.linting.pylintPath": "/opt/netbox/venv/bin/pylint",
64+
"python.linting.lintOnSave": true,
6065
"python.pythonPath": "/opt/netbox/venv/bin/python3",
6166
"python.terminal.activateEnvironment": true,
6267
"python.venvPath": "/opt/netbox/",
@@ -83,6 +88,7 @@
8388
"ms-python.python",
8489
"ms-python.vscode-pylance",
8590
"mutantdino.resourcemonitor",
91+
"paulomenezes.duplicated-code",
8692
"searKing.preview-vscode",
8793
"sourcery.sourcery"
8894
]

.devcontainer/initializers/aggregates.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
- prefix: 10.0.0.0/16
32
rir: RFC1918
43
tenant: tenant1

.devcontainer/initializers/asns.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
- asn: 1
32
rir: RFC1918
43
tenant: tenant1

.devcontainer/initializers/cables.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Required parameters for termination X ('a' or 'b'):
2+
#
3+
# ```
4+
# termination_x_name -> name of interface
5+
# termination_x_device -> name of the device interface belongs to
6+
# termination_x_class -> required if different than 'Interface' which is the default
7+
# ```
8+
#
9+
# Supported termination classes: Interface, ConsolePort, ConsoleServerPort, FrontPort, RearPort, PowerPort, PowerOutlet
10+
#
11+
#
12+
# If a termination is a circuit then the required parameter is termination_x_circuit.
13+
# Required parameters for a circuit termination:
14+
#
15+
# ```
16+
# termination_x_circuit:
17+
# term_side -> termination side of a circuit. Must be A or B
18+
# cid -> circuit ID value
19+
# site OR provider_network -> name of Site or ProviderNetwork respectively. If both provided, Site takes precedence
20+
# ```
21+
#
22+
# If a termination is a power feed then the required parameter is termination_x_feed.
23+
#
24+
# ```
25+
# termination_x_feed:
26+
# name -> name of the PowerFeed object
27+
# power_panel:
28+
# name -> name of the PowerPanel the PowerFeed is attached to
29+
# site -> name of the Site in which the PowerPanel is present
30+
# ```
31+
#
32+
# Any other Cable parameters supported by Netbox are supported as the top level keys, e.g. 'type', 'status', etc.
33+
#
34+
# - termination_a_name: console
35+
# termination_a_device: spine
36+
# termination_a_class: ConsolePort
37+
# termination_b_name: tty9
38+
# termination_b_device: console-server
39+
# termination_b_class: ConsoleServerPort
40+
# type: cat6
41+
#
42+
- termination_a_name: to-server02
43+
termination_a_device: server01
44+
termination_b_name: to-server01
45+
termination_b_device: server02
46+
status: planned
47+
type: mmf
48+
49+
- termination_a_name: eth0
50+
termination_a_device: server02
51+
termination_b_circuit:
52+
term_side: A
53+
cid: Circuit_ID-1
54+
site: AMS 1
55+
type: cat6
56+
57+
- termination_a_name: psu0
58+
termination_a_device: server04
59+
termination_a_class: PowerPort
60+
termination_b_feed:
61+
name: power feed 1
62+
power_panel:
63+
name: power panel AMS 1
64+
site: AMS 1
65+
66+
- termination_a_name: outlet1
67+
termination_a_device: server04
68+
termination_a_class: PowerOutlet
69+
termination_b_name: psu1
70+
termination_b_device: server04
71+
termination_b_class: PowerPort

.devcontainer/initializers/circuit_types.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
- name: VPLS
32
slug: vpls
43
- name: MPLS

.devcontainer/initializers/circuits.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
- cid: Circuit_ID-1
32
provider: Provider1
43
type: Internet

.devcontainer/initializers/cluster_groups.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
- name: Group 1
32
slug: group-1
43
- name: Group 2
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
---
21
- name: Hyper-V
32
slug: hyper-v

0 commit comments

Comments
 (0)