Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General CI Fix #573

Merged
merged 25 commits into from
Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
96c8865
add cert option to module documentation
ryanmerolle Aug 5, 2021
5fbf258
correct tab mistake
ryanmerolle Aug 5, 2021
a41bd4a
add cert type to modules documentation
ryanmerolle Aug 5, 2021
6c4e1b0
set cert default to false
ryanmerolle Aug 5, 2021
5561a0a
remove cert default
ryanmerolle Aug 5, 2021
437dfaf
fix last remaining missing cert reference
ryanmerolle Aug 5, 2021
147b45d
Merge branch 'netbox-community:devel' into devel
ryanmerolle Sep 11, 2021
0322a48
address list but elements is not defined CI error
ryanmerolle Sep 11, 2021
22ec0b7
correct black linting quotes
ryanmerolle Sep 11, 2021
2987988
correct tags documentation
ryanmerolle Sep 11, 2021
51b2411
correct duplicate keys
ryanmerolle Sep 11, 2021
2567623
correct key mistake find/replace
ryanmerolle Sep 11, 2021
a0194a8
correct elements mistake in netbox_service
ryanmerolle Sep 11, 2021
18fd9ce
poetry bump
ryanmerolle Sep 11, 2021
0471ffe
change tags elements from str to raw
ryanmerolle Sep 11, 2021
f4f597f
tweak validate-modules ignore
ryanmerolle Sep 11, 2021
c92e2ca
remove ignore for sanity check
ryanmerolle Sep 11, 2021
7715870
set cert to None in test_netbox_base_class.py
ryanmerolle Sep 11, 2021
c256210
corret black linting
ryanmerolle Sep 11, 2021
04df171
add netbox 2.11 testing
ryanmerolle Sep 11, 2021
f7b722a
pin integration test versions instead of latest
ryanmerolle Sep 11, 2021
9da8b1a
correct github workflow stage name
ryanmerolle Sep 11, 2021
527a2e1
correct failure if cert is not set in task
ryanmerolle Sep 12, 2021
bdc87bb
ping netbox versions in integration/unit testing
ryanmerolle Sep 13, 2021
4d1b7a1
comment out netbox v3.0 testing
ryanmerolle Sep 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ jobs:
VERSION: "v2.10"
INTEGRATION_TESTS: "v2.10"
- python-version: 3.6
VERSION: "latest"
INTEGRATION_TESTS: "latest"
VERSION: "v2.11"
INTEGRATION_TESTS: "v2.11"
#- python-version: 3.6
# VERSION: "v3.0"
# INTEGRATION_TESTS: "v3.0"
steps:
- name: Checkout repo
uses: actions/checkout@v2
Expand All @@ -70,31 +73,54 @@ jobs:
version: '3.4'
services:
netbox:
image: netboxcommunity/netbox:v2.10
ports:
- 32768:8080
EOF
docker-compose up -d --quiet-pull
docker container ls
cd ..
if: matrix.VERSION == 'v2.10'
- name: Clone & Start netbox-docker containers - latest
- name: Clone & Start netbox-docker containers - 2.11
env:
VERSION: ${{ matrix.VERSION }}
run: |
cd ..
git clone https://github.com/netbox-community/netbox-docker.git
cd netbox-docker
git checkout 1.2.0
tee docker-compose.override.yml <<EOF
version: '3.4'
services:
netbox:
image: netboxcommunity/netbox:v2.11
ports:
- 32768:8080
EOF
docker-compose up -d --quiet-pull
docker container ls
cd ..
if: matrix.VERSION == 'latest'
if: matrix.VERSION == 'v2.11'
- name: Clone & Start netbox-docker containers - 3.0
env:
VERSION: ${{ matrix.VERSION }}
run: |
cd ..
git clone https://github.com/netbox-community/netbox-docker.git
cd netbox-docker
git checkout 1.3.1
tee docker-compose.override.yml <<EOF
version: '3.4'
services:
netbox:
image: netboxcommunity/netbox:v3.0
ports:
- 32768:8080
EOF
docker-compose up -d --quiet-pull
docker container ls
cd ..
if: matrix.VERSION == 'v3.0'
- name: Install and configure Poetry
uses: snok/[email protected]
with:
Expand Down
3 changes: 2 additions & 1 deletion docs/getting_started/contributing/modules/new_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ Now we need to update the ``DOCUMENTATION`` variable to match the module we're c
- Any tags that the device may need to be associated with
required: false
type: list
elements: raw
custom_fields:
description:
- must exist in Netbox
Expand Down Expand Up @@ -282,7 +283,7 @@ Let's move onto the ``main()`` function in the module and take a look at the req
name=dict(required=True, type="str"),
tenant=dict(required=False, type="raw"),
description=dict(required=False, type="str"),
tags=dict(required=False, type="list"),
tags=dict(required=False, type="list", elements="raw"),
custom_fields=dict(required=False, type="dict"),
),
),
Expand Down
3 changes: 2 additions & 1 deletion plugins/module_utils/netbox_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,8 @@ def _connect_netbox_api(self, url, token, ssl_verify, cert):
try:
session = requests.Session()
session.verify = ssl_verify
session.cert = tuple(i for i in cert)
if cert:
session.cert = tuple(i for i in cert)
nb = pynetbox.api(url, token=token)
nb.http_session = session
try:
Expand Down
8 changes: 7 additions & 1 deletion plugins/modules/netbox_aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
- "The token created within Netbox to authorize API access"
required: true
type: str
cert:
description:
- Certificate path
required: false
type: raw
data:
description:
- "Defines the aggregate configuration"
Expand Down Expand Up @@ -68,6 +73,7 @@
- "Any tags that the aggregate may need to be associated with"
required: false
type: list
elements: raw
custom_fields:
description:
- "must exist in Netbox"
Expand Down Expand Up @@ -170,7 +176,7 @@ def main():
rir=dict(required=False, type="raw"),
date_added=dict(required=False, type="str"),
description=dict(required=False, type="str"),
tags=dict(required=False, type="list"),
tags=dict(required=False, type="list", elements="raw"),
custom_fields=dict(required=False, type="dict"),
),
),
Expand Down
9 changes: 7 additions & 2 deletions plugins/modules/netbox_cable.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
- The token created within Netbox to authorize API access
required: true
type: str
cert:
description:
- Certificate path
required: false
type: raw
data:
type: dict
required: true
Expand Down Expand Up @@ -150,7 +155,7 @@
- Any tags that the cable may need to be associated with
required: false
type: list
elements: str
elements: raw
state:
description:
- Use C(present) or C(absent) for adding or removing.
Expand Down Expand Up @@ -335,7 +340,7 @@ def main():
length_unit=dict(
required=False, choices=["m", "cm", "ft", "in"], type="str"
),
tags=dict(required=False, type="list", elements="str"),
tags=dict(required=False, type="list", elements="raw"),
),
),
)
Expand Down
8 changes: 7 additions & 1 deletion plugins/modules/netbox_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
- The token created within Netbox to authorize API access
required: true
type: str
cert:
description:
- Certificate path
required: false
type: raw
data:
type: dict
required: true
Expand Down Expand Up @@ -94,6 +99,7 @@
- Any tags that the device may need to be associated with
required: false
type: list
elements: raw
custom_fields:
description:
- must exist in Netbox
Expand Down Expand Up @@ -204,7 +210,7 @@ def main():
commit_rate=dict(required=False, type="int"),
description=dict(required=False, type="str"),
comments=dict(required=False, type="str"),
tags=dict(required=False, type="list"),
tags=dict(required=False, type="list", elements="raw"),
custom_fields=dict(required=False, type="dict"),
),
),
Expand Down
5 changes: 5 additions & 0 deletions plugins/modules/netbox_circuit_termination.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
- The token created within Netbox to authorize API access
required: true
type: str
cert:
description:
- Certificate path
required: false
type: raw
data:
required: true
type: dict
Expand Down
5 changes: 5 additions & 0 deletions plugins/modules/netbox_circuit_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
- The token created within Netbox to authorize API access
required: true
type: str
cert:
description:
- Certificate path
required: false
type: raw
data:
required: true
type: dict
Expand Down
8 changes: 7 additions & 1 deletion plugins/modules/netbox_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
- The token created within Netbox to authorize API access
required: true
type: str
cert:
description:
- Certificate path
required: false
type: raw
data:
required: true
type: dict
Expand Down Expand Up @@ -79,6 +84,7 @@
- Any tags that the cluster may need to be associated with
required: false
type: list
elements: raw
custom_fields:
description:
- must exist in Netbox
Expand Down Expand Up @@ -191,7 +197,7 @@ def main():
site=dict(required=False, type="raw"),
tenant=dict(required=False, type="raw"),
comments=dict(required=False, type="str"),
tags=dict(required=False, type="list"),
tags=dict(required=False, type="list", elements="raw"),
custom_fields=dict(required=False, type="dict"),
),
),
Expand Down
5 changes: 5 additions & 0 deletions plugins/modules/netbox_cluster_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
- The token created within Netbox to authorize API access
required: true
type: str
cert:
description:
- Certificate path
required: false
type: raw
data:
required: true
type: dict
Expand Down
5 changes: 5 additions & 0 deletions plugins/modules/netbox_cluster_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
- The token created within Netbox to authorize API access
required: true
type: str
cert:
description:
- Certificate path
required: false
type: raw
data:
required: true
type: dict
Expand Down
8 changes: 7 additions & 1 deletion plugins/modules/netbox_console_port.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
- The token created within Netbox to authorize API access
required: true
type: str
cert:
description:
- Certificate path
required: false
type: raw
data:
type: dict
required: true
Expand Down Expand Up @@ -84,6 +89,7 @@
- Any tags that the console port may need to be associated with
required: false
type: list
elements: raw
state:
description:
- Use C(present) or C(absent) for adding or removing.
Expand Down Expand Up @@ -197,7 +203,7 @@ def main():
type="str",
),
description=dict(required=False, type="str"),
tags=dict(required=False, type="list"),
tags=dict(required=False, type="list", elements="raw"),
),
),
)
Expand Down
5 changes: 5 additions & 0 deletions plugins/modules/netbox_console_port_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
- The token created within Netbox to authorize API access
required: true
type: str
cert:
description:
- Certificate path
required: false
type: raw
data:
type: dict
required: true
Expand Down
8 changes: 7 additions & 1 deletion plugins/modules/netbox_console_server_port.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
- The token created within Netbox to authorize API access
required: true
type: str
cert:
description:
- Certificate path
required: false
type: raw
data:
type: dict
required: true
Expand Down Expand Up @@ -84,6 +89,7 @@
- Any tags that the console server port may need to be associated with
required: false
type: list
elements: raw
state:
description:
- Use C(present) or C(absent) for adding or removing.
Expand Down Expand Up @@ -197,7 +203,7 @@ def main():
type="str",
),
description=dict(required=False, type="str"),
tags=dict(required=False, type="list"),
tags=dict(required=False, type="list", elements="raw"),
),
),
)
Expand Down
5 changes: 5 additions & 0 deletions plugins/modules/netbox_console_server_port_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
- The token created within Netbox to authorize API access
required: true
type: str
cert:
description:
- Certificate path
required: false
type: raw
data:
type: dict
required: true
Expand Down
8 changes: 7 additions & 1 deletion plugins/modules/netbox_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
- The token created within Netbox to authorize API access
required: true
type: str
cert:
description:
- Certificate path
required: false
type: raw
data:
description:
- Defines the device configuration
Expand Down Expand Up @@ -149,6 +154,7 @@
- Any tags that the device may need to be associated with
required: false
type: list
elements: raw
custom_fields:
description:
- must exist in Netbox
Expand Down Expand Up @@ -303,7 +309,7 @@ def main():
vc_position=dict(required=False, type="int"),
vc_priority=dict(required=False, type="int"),
comments=dict(required=False, type="str"),
tags=dict(required=False, type="list"),
tags=dict(required=False, type="list", elements="raw"),
local_context_data=dict(required=False, type="dict"),
custom_fields=dict(required=False, type="dict"),
),
Expand Down
Loading