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

Develop to main for release #484

Merged
merged 23 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7131d31
Adds ansible 2.18 & py3.12; removes py3.10
joewesch Dec 20, 2024
2a9de54
Merge pull request #470 from nautobot/u/joewesch-468-ansible-2.18
joewesch Dec 23, 2024
287185f
Adds examples for custom fields in compose
joewesch Dec 23, 2024
a201be7
Adding test of composed custom fields
joewesch Dec 24, 2024
74a4aec
Update lookup.py to honour template variables
chadell Dec 24, 2024
4d522cd
Replaces sanity test ignore
joewesch Dec 24, 2024
804db71
Updates docs to include conditional requirement
joewesch Dec 24, 2024
04bc6ab
Fix documentation for lookup_graphql.py
chadell Dec 27, 2024
7b06f04
Merge pull request #477 from nautobot/fix-doc-lookupgrapqhl
joewesch Dec 30, 2024
26e870c
add basic testing
chadell Dec 31, 2024
1181d1f
filters test
chadell Dec 31, 2024
4ee39b0
Merge pull request #472 from nautobot/u/joewesch-50-compose-cfs
joewesch Jan 2, 2025
7a89496
Merge pull request #474 from nautobot/fix-lookup
joewesch Jan 2, 2025
7081a98
Merge pull request #475 from nautobot/u/joewesch-250-interface-docs
joewesch Jan 2, 2025
ab54b56
Fixes creating cables with power ports/outlets
joewesch Jan 3, 2025
5f654f4
Merge pull request #478 from nautobot/u/joewesch-320-cable-ids
joewesch Jan 7, 2025
abcae59
Update utils.py
netgirard Jan 8, 2025
f3219fd
Update plugins/module_utils/utils.py
joewesch Jan 8, 2025
fe69ccb
Merge pull request #480 from netgirard/support_env_fallback
joewesch Jan 8, 2025
dfd1077
Adds env fallback for validate_certs
joewesch Jan 8, 2025
0f7a166
Merge pull request #481 from nautobot/u/joewesch-479-env-vars
joewesch Jan 9, 2025
0552437
Release v5.6.0
joewesch Jan 9, 2025
077a62f
Merge pull request #483 from nautobot/release-v5.6.0
joewesch Jan 9, 2025
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
4 changes: 3 additions & 1 deletion .bandit.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
skips: []
# No need to check for security issues in the test scripts!
exclude_dirs:
# No need to check for security issues in the test scripts!
- "./tests/"
# Ignore locally installed collection
- "./collections/"
2 changes: 1 addition & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: # yamllint disable
runs-on:
description: "The OS to run the job on"
required: false
default: "ubuntu-22.04"
default: "ubuntu-24.04"
type: string
python-version:
description: "The Python version to use"
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: # yamllint disable
runs-on:
description: "The OS to run the job on"
required: false
default: "ubuntu-22.04"
default: "ubuntu-24.04"
type: string
full-integration:
description: "Run full integration tests"
Expand All @@ -30,8 +30,8 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
env:
INVOKE_NAUTOBOT_ANSIBLE_PYTHON_VER: "${{ matrix.python-version }}"
steps:
Expand All @@ -51,12 +51,12 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.11"
- "3.12"
nautobot-version:
- "2.3"
ansible-version:
- "2.16"
- "2.17"
- "2.18"
with:
python-version: "${{ matrix.python-version }}"
nautobot-version: "${{ matrix.nautobot-version }}"
Expand All @@ -70,8 +70,8 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
nautobot-version:
- "2.0"
- "2.1"
Expand All @@ -80,6 +80,14 @@ jobs:
ansible-version:
- "2.16"
- "2.17"
- "2.18"
exclude:
- python-version: "3.12"
nautobot-version: "2.0"
- python-version: "3.12"
nautobot-version: "2.1"
- python-version: "3.12"
nautobot-version: "2.2"
with:
python-version: "${{ matrix.python-version }}"
nautobot-version: "${{ matrix.nautobot-version }}"
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/trigger_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: # yamllint disable

jobs:
lint:
runs-on: "ubuntu-22.04"
runs-on: "ubuntu-24.04"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
Expand All @@ -15,13 +15,13 @@ jobs:
- name: "Linting"
run: "invoke lint"
unit:
runs-on: "ubuntu-22.04"
runs-on: "ubuntu-24.04"
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
env:
INVOKE_NAUTOBOT_ANSIBLE_PYTHON_VER: "${{ matrix.python-version }}"
steps:
Expand All @@ -39,8 +39,8 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
nautobot-version:
- "2.0"
- "2.1"
Expand All @@ -49,6 +49,14 @@ jobs:
ansible-version:
- "2.16"
- "2.17"
- "2.18"
exclude:
- python-version: "3.12"
nautobot-version: "2.0"
- python-version: "3.12"
nautobot-version: "2.1"
- python-version: "3.12"
nautobot-version: "2.2"
with:
python-version: "${{ matrix.python-version }}"
nautobot-version: "${{ matrix.nautobot-version }}"
Expand All @@ -57,15 +65,15 @@ jobs:
- "unit"
publish_github:
name: "Publish to GitHub"
runs-on: "ubuntu-22.04"
runs-on: "ubuntu-24.04"
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.10"
python-version: "3.11"
- name: "Install Python Packages"
run: "pip install ansible-core"
- name: "Build the collection"
Expand All @@ -82,15 +90,15 @@ jobs:
- "integration"
publish_galaxy:
name: "Publish to Ansible Galaxy"
runs-on: "ubuntu-22.04"
runs-on: "ubuntu-24.04"
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.10"
python-version: "3.11"
- name: "Install Python Packages"
run: "pip install ansible-core"
- name: "Create the ansible.cfg file"
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ version: 2

# Set the version of Python in the build environment.
build:
os: "ubuntu-22.04"
os: "ubuntu-24.04"
tools:
python: "3.10"
python: "3.11"
jobs:
post_install:
- "ansible-galaxy collection install . --force"
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# networktocode.nautobot Release Notes

v5.6.0
======

Minor Changes
-------------
- (#470) Dropped support for Python 3.10 to follow ansible-core 2.18
- (#472) Added documentation on using custom fields in compose variables with the `inventory` plugin
- (#474) Fixed `lookup` plugin to properly handle templated variables in `api_filter`
- (#475) Added documentation for the `device_interface` module that `type` is required when creating a new interface
- (#477) Fixed query example in the `lookup_graphql` plugin documentation for compatibility with Nautobot 2.X
- (#478) Fixed the `cable` module to properly work with all cable types
- (#480) Fixed environment variable fallback for `url` and `token` in all modules
- (#481) Fixed environment variable fallback for `validate_certs` in all modules

v5.5.0
======

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#
# This base stage just installs the dependencies required for production
# without any development deps.
ARG PYTHON_VER=3.10
ARG PYTHON_VER=3.11
FROM python:${PYTHON_VER} AS base

# Allow for flexible Python versions, for broader testing
ARG PYTHON_VER=3.10
ARG PYTHON_VER=3.11
ENV PYTHON_VERSION=${PYTHON_VER}
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -yqq && apt-get install -yqq shellcheck && apt-get clean
Expand Down Expand Up @@ -60,7 +60,7 @@ FROM lint AS unittests
ARG ANSIBLE_COLLECTIONS_PATH=/usr/share/ansible/collections
ENV ANSIBLE_COLLECTIONS_PATH=${ANSIBLE_COLLECTIONS_PATH}

ARG PYTHON_VER=3.10
ARG PYTHON_VER=3.11
ENV PYTHON_VERSION=${PYTHON_VER}

# Allows for custom command line arguments to be passed to ansible-test (like -vvv)
Expand Down Expand Up @@ -89,7 +89,7 @@ RUN ansible-test sanity $ANSIBLE_SANITY_ARGS \
plugins/

# Run unit tests
RUN ansible-test units $ANSIBLE_UNIT_ARGS --coverage --python ${PYTHON_VERSION}
RUN ansible-test units $ANSIBLE_UNIT_ARGS --coverage --requirements --python ${PYTHON_VERSION}

############
# Integration Tests
Expand Down
11 changes: 11 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -545,3 +545,14 @@ releases:
minor_changes:
- (#464) Added full support for caching to GraphQL Inventory plugin
- (#465) Changed `parent_location_type` to allow for explicit name attribute lookup
5.6.0:
changes:
minor_changes:
- (#470) Dropped support for Python 3.10 to follow ansible-core 2.18
- (#472) Added documentation on using custom fields in compose variables with the `inventory` plugin
- (#474) Fixed `lookup` plugin to properly handle templated variables in `api_filter`
- (#475) Added documentation for the `device_interface` module that `type` is required when creating a new interface
- (#477) Fixed query example in the `lookup_graphql` plugin documentation for compatibility with Nautobot 2.X
- (#478) Fixed the `cable` module to properly work with all cable types
- (#480) Fixed environment variable fallback for `url` and `token` in all modules
- (#481) Fixed environment variable fallback for `validate_certs` in all modules
2 changes: 1 addition & 1 deletion development/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nautobot-bgp-models==0.20.0
nautobot-bgp-models==2.3.0
8 changes: 7 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
x-args:
&args
PYTHON_VER: ${PYTHON_VER}
ANSIBLE_SANITY_ARGS: ${ANSIBLE_SANITY_ARGS:-}
ANSIBLE_UNIT_ARGS: ${ANSIBLE_UNIT_ARGS:-}
# Build block with context and target default
x-build:
&build
Expand All @@ -14,7 +16,8 @@ x-service:
ANSIBLE_INTEGRATION_ARGS: ${ANSIBLE_INTEGRATION_ARGS:-}
ANSIBLE_SANITY_ARGS: ${ANSIBLE_SANITY_ARGS:-}
ANSIBLE_UNIT_ARGS: ${ANSIBLE_UNIT_ARGS:-}
NAUTOBOT_VER: ${INVOKE_NAUTOBOT_ANSIBLE_NAUTOBOT_VER:-}
NAUTOBOT_VER: ${NAUTOBOT_VER:-}
OUTPUT_INVENTORY_JSON: ${OUTPUT_INVENTORY_JSON:-}

services:
unit:
Expand All @@ -33,3 +36,6 @@ services:
build:
<<: *build
target: integration
volumes:
# This allows us to update the inventory files from inside the container
- ${PWD}/tests/integration/targets/inventory/files/:/tmp/inventory_files/
10 changes: 10 additions & 0 deletions docs/getting_started/how-to-use/inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ compose:
ansible_network_os: platform.network_driver
```

You can also use custom fields on the device or a nested object.

```yaml
---
plugin: networktocode.nautobot.inventory
compose:
device_owner: custom_fields.device_owner
ansible_network_os: platforms.custom_fields.ansible_network_os
```

## Using Keyed Groups to set `ansible_network_os` to Platform Network Driver

```yaml
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ansible-core==2.15.12
ansible-core==2.18
mkdocs==1.6.1
mkdocs-ansible-collection==0.2.0
mkdocs-material==9.5.30
Expand Down
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace: networktocode
name: nautobot

# The version of the collection. Must be compatible with semantic versioning
version: 5.5.0
version: 5.6.0

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
21 changes: 13 additions & 8 deletions hacking/local-test.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
#!/usr/bin/env bash

# Usage: ./hacking/local-test.sh
################################################################################
# DEPRECATED
# Run `invoke unit` or `invoke integration` to run the tests locally instead!
################################################################################

# Run build, which will remove previously installed versions
./hacking/build.sh
# # Usage: ./hacking/local-test.sh

# Install new built version
ansible-galaxy collection install networktocode-nautobot-*.tar.gz -p .
# # Run build, which will remove previously installed versions
# ./hacking/build.sh

# You can now cd into the installed version and run tests
(cd ansible_collections/networktocode/nautobot/ && ansible-test units -v --python 3.9 && ansible-test sanity --requirements -v --python 3.9 --skip-test pep8 plugins/)
rm -rf ansible_collections
# # Install new built version
# ansible-galaxy collection install networktocode-nautobot-*.tar.gz -p .

# # You can now cd into the installed version and run tests
# (cd ansible_collections/networktocode/nautobot/ && ansible-test units -v --python 3.9 && ansible-test sanity --requirements -v --python 3.9 --skip-test pep8 plugins/)
# rm -rf ansible_collections
19 changes: 12 additions & 7 deletions hacking/make-docs.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#!/usr/bin/env bash

# Usage: ./hacking/make-docs.sh
################################################################################
# DEPRECATED
# Run `invoke docs` to host the docs locally instead!
################################################################################

# Run build, which will remove previously installed versions
./hacking/build.sh
# # Usage: ./hacking/make-docs.sh

# Install new built version
ansible-galaxy collection install networktocode-nautobot-*.tar.gz -f
# # Run build, which will remove previously installed versions
# ./hacking/build.sh

# Run antisbull-docs now
antsibull-docs collection --use-current --squash-hierarchy --dest-dir docs/plugins/ networktocode.nautobot
# # Install new built version
# ansible-galaxy collection install networktocode-nautobot-*.tar.gz -f

# # Run antisbull-docs now
# antsibull-docs collection --use-current --squash-hierarchy --dest-dir docs/plugins/ networktocode.nautobot
Loading