Skip to content

Commit

Permalink
Merge pull request #1001 from netbox-community/devel
Browse files Browse the repository at this point in the history
Release 3.13
  • Loading branch information
rodvand authored May 10, 2023
2 parents cb0f86d + 782584b commit f6d52d2
Show file tree
Hide file tree
Showing 360 changed files with 5,306 additions and 18,859 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ body:
attributes:
value: >
**NOTE:** This form is only for reporting _reproducible bugs_ in a current NetBox Collection
installation.
installation.
- See the latest ansible module documentation:
https://netbox-ansible-collection.readthedocs.io
- Check the release notes:
Expand All @@ -33,7 +33,7 @@ body:
label: Ansible version
description: >
What version of the Ansible NetBox Collection are you currently running?
Paste the output of "ansible --version"
Paste the output of "ansible --version"
value: >
```bash
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Reference: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: false
contact_links:
Expand Down
162 changes: 71 additions & 91 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,163 +1,143 @@
---
name: All CI related tasks

# Run this workflow every time a new commit pushed to your repository
on: [push, pull_request]

jobs:
linting_unit_testing:
linting:
runs-on: ubuntu-latest
steps:

- name: Checkout repo
uses: actions/checkout@v3

- name: Run black
uses: psf/black@stable

- name: 'Yamllint'
uses: karancode/yamllint-github-action@master

#- name: Run isort
# uses: jamescurtin/isort-action@master

#- name: Run ruff
# uses: chartboost/ruff-action@v1

unit_testing:
runs-on: ubuntu-latest
needs: linting
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]

steps:

- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false

- name: Install Python packages
run: poetry install

- name: Build and install collection
run: |
ansible-galaxy collection build .
ansible-galaxy collection install netbox*.tar.gz -p /home/runner/.ansible/collections
- name: Run Black
run: poetry run black . --check --diff
- name: Run Ansible Sanity tests
run: poetry run ansible-test sanity -v --requirements --python ${{ matrix.python-version }} --skip-test pep8 plugins/
working-directory: /home/runner/.ansible/collections/ansible_collections/netbox/netbox

- name: Run Ansible Unit tests
run: poetry run ansible-test units -vvv --coverage --python ${{ matrix.python-version }}
working-directory: /home/runner/.ansible/collections/ansible_collections/netbox/netbox

- name: Run Ansible Coverage
run: poetry run ansible-test coverage report --all --omit "tests/*,hacking/*,docs/*" --show-missing
working-directory: /home/runner/.ansible/collections/ansible_collections/netbox/netbox
integration:

integration_testing:
runs-on: ubuntu-latest
needs: linting_unit_testing
needs: unit_testing
env:
python-version: "3.9"
strategy:
fail-fast: false
matrix:
include:
- python-version: 3.8
VERSION: "v3.2"
INTEGRATION_TESTS: "v3.2"
- python-version: 3.8
VERSION: "v3.3"
INTEGRATION_TESTS: "v3.3"
- python-version: 3.8
VERSION: "v3.4"
INTEGRATION_TESTS: "v3.4"
include:
- VERSION: "v3.3"
NETBOX_DOCKER_VERSION: 2.3.0
- VERSION: "v3.4"
NETBOX_DOCKER_VERSION: 2.5.3
- VERSION: "v3.5"
NETBOX_DOCKER_VERSION: 2.6.1
# If we want to integration test wiht all supported Python:
#python-version: ["3.9", "3.10", "3.11"]

steps:

- name: Checkout repo
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Clone & Start netbox-docker containers - 3.2
env:
VERSION: ${{ matrix.VERSION }}
run: |
cd ..
git clone https://github.com/netbox-community/netbox-docker.git
cd netbox-docker
git checkout 1.6.1
tee docker-compose.override.yml <<EOF
version: '3.4'
services:
netbox:
image: netboxcommunity/netbox:v3.2
ports:
- 32768:8080
EOF
docker-compose up -d --quiet-pull
docker container ls
cd ..
if: matrix.VERSION == 'v3.2'
- name: Clone & Start netbox-docker containers - 3.3
env:
VERSION: ${{ matrix.VERSION }}
run: |
cd ..
git clone https://github.com/netbox-community/netbox-docker.git
cd netbox-docker
git checkout 2.2.0
tee docker-compose.override.yml <<EOF
version: '3.4'
services:
netbox:
image: netboxcommunity/netbox:v3.3
ports:
- 32768:8080
EOF
docker-compose up -d --quiet-pull
docker container ls
cd ..
if: matrix.VERSION == 'v3.3'
- name: Clone & Start netbox-docker containers - 3.4
env:
VERSION: ${{ matrix.VERSION }}
uses: actions/checkout@v3

- name: Clone & Start netbox-docker containers - ${{ matrix.VERSION }}
run: |
cd ..
git clone https://github.com/netbox-community/netbox-docker.git
cd netbox-docker
git checkout 2.3.0
tee docker-compose.override.yml <<EOF
version: '3.4'
services:
netbox:
image: netboxcommunity/netbox:v3.4
ports:
- 32768:8080
EOF
docker-compose up -d --quiet-pull
git checkout ${{ matrix.NETBOX_DOCKER_VERSION }}
cp $GITHUB_WORKSPACE/tests/netbox-docker/${{ matrix.VERSION }}/docker-compose.override.yml docker-compose.override.yml
docker-compose up -d --quiet-pull netbox netbox-worker postgres redis redis-cache
docker container ls
cd ..
if: matrix.VERSION == 'v3.4'
- name: Set up Python ${{ env.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}

- name: Install and configure Poetry
uses: snok/[email protected]
with:
virtualenvs-create: false

- name: Install Python packages
run: poetry install

- name: Build and install collection
run: |
ansible-galaxy collection install community.general -p /home/runner/.ansible/collections
ansible-galaxy collection build .
ansible-galaxy collection install netbox*.tar.gz -p /home/runner/.ansible/collections
- name: Wait for NetBox to be available
run: |
docker container ls
docker logs netbox-docker_netbox_1
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:32768)" != "200" ]]; do echo "waiting for NetBox"; sleep 5; done' || false
working-directory: /home/runner/.ansible/collections/ansible_collections/netbox/netbox
#if: matrix.VERSION == 'v3.3'

- name: Pre-populate NetBox
run: ./tests/integration/netbox-deploy.py
working-directory: /home/runner/.ansible/collections/ansible_collections/netbox/netbox
- name: Allow scripts to be executed
# Set runme.sh execute permissions stripped by ansible-galaxy. Should be fixed in Ansible 2.10
# https://github.com/ansible/ansible/issues/68415
# Run render_config.sh to pass environment variables to integration tests
# https://www.ansible.com/blog/adding-integration-tests-to-ansible-content-collections
run: |
chmod +x tests/integration/targets/inventory-${{ matrix.INTEGRATION_TESTS }}/runme.sh
chmod +x tests/integration/targets/inventory-${{ matrix.INTEGRATION_TESTS }}/compare_inventory_json.py
chmod +x tests/integration/render_config.sh
tests/integration/render_config.sh tests/integration/targets/inventory/runme_config.template > tests/integration/targets/inventory-${{ matrix.INTEGRATION_TESTS }}/runme_config
working-directory: /home/runner/.ansible/collections/ansible_collections/netbox/netbox

- name: Run integration tests
# Run regression and integration tests
# Run the inventory test first, in case any of the other tests modify the data.
run: |
ansible-test integration -v --color --coverage --python ${{ matrix.python-version }} inventory-${{ matrix.INTEGRATION_TESTS }}
ansible-test integration -v --color --coverage --python ${{ matrix.python-version }} regression-${{ matrix.INTEGRATION_TESTS }}
ansible-test integration -v --color --coverage --python ${{ matrix.python-version }} ${{ matrix.INTEGRATION_TESTS }}
ansible-test integration -v --color --coverage --python ${{ env.python-version }} inventory-${{ matrix.VERSION }}
ansible-test integration -v --color --coverage --python ${{ env.python-version }} regression-${{ matrix.VERSION }}
ansible-test integration -v --color --coverage --python ${{ env.python-version }} ${{ matrix.VERSION }}
ansible-test coverage report --all --omit "tests/*,hacking/*,docs/*" --show-missing
working-directory: /home/runner/.ansible/collections/ansible_collections/netbox/netbox
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Deploy collection to Ansible Galaxy
on:
create:
Expand Down
7 changes: 6 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
---
version: 2
#sphinx:
# configuration: docs/conf.py

build:
os: ubuntu-22.04
tools:
python: "3.9"

python:
version: 3.8
install:
- requirements: docs/requirements.txt
32 changes: 32 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---

yaml-files:
- '*.yaml'
- '*.yml'
- '.yamllint'

rules:
anchors: enable
braces: enable
brackets: enable
colons: enable
commas: enable
comments: disable
comments-indentation: disable
document-end: disable
document-start:
level: warning
empty-lines: enable
empty-values: enable
float-values: disable
hyphens: enable
indentation: disable
key-duplicates: enable
key-ordering: disable
line-length: disable
new-line-at-end-of-file: enable
new-lines: enable
octal-values: disable
quoted-strings: disable
trailing-spaces: enable
truthy: disable
21 changes: 21 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ NetBox.NetBox Release Notes
.. contents:: Topics


v3.13.0
=======

Minor Changes
-------------

- nb_inventory - Enable NetBox 3.5 support [#999](https://github.com/netbox-community/ansible_modules/pull/999)
- netbox_fhrp_group_assignment - Add module [#974](https://github.com/netbox-community/ansible_modules/pull/974)
- netbox_lsvpn_termination - Add module [#994](https://github.com/netbox-community/ansible_modules/pull/994)

Bugfixes
--------

- netbox_cable - Fix idempotency [#990](https://github.com/netbox-community/ansible_modules/pull/990)

New Modules
-----------

- netbox.netbox.netbox_fhrp_group_assignment - Creates, updates or removes FHRP group assignments from NetBox
- netbox.netbox.netbox_lsvpn_termination - Creates, updates or removes L2VPNs terminations from NetBox

v3.12.0
=======

Expand Down
Loading

0 comments on commit f6d52d2

Please sign in to comment.