Skip to content

Commit 90a506f

Browse files
authored
Merge pull request #1389 from netbox-community/devel
Release 3.21
2 parents de3ef6c + f013f45 commit 90a506f

File tree

451 files changed

+5164
-42801
lines changed

Some content is hidden

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

451 files changed

+5164
-42801
lines changed

.github/workflows/main.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ jobs:
1616
uses: psf/black@stable
1717

1818
unit_testing:
19-
runs-on: ubuntu-20.04
19+
runs-on: ubuntu-24.04
2020
needs: linting
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
python-version: ["3.10", "3.11"]
24+
python-version: ["3.13"]
2525

2626
steps:
2727

@@ -39,7 +39,7 @@ jobs:
3939
virtualenvs-create: false
4040

4141
- name: Install Python packages
42-
run: poetry install
42+
run: poetry install --no-root
4343

4444
- name: Build and install collection
4545
run: |
@@ -62,17 +62,17 @@ jobs:
6262
runs-on: ubuntu-latest
6363
needs: unit_testing
6464
env:
65-
python-version: "3.12"
65+
python-version: "3.13"
6666
strategy:
6767
fail-fast: false
6868
matrix:
69-
include:
70-
- VERSION: "v3.7"
71-
NETBOX_DOCKER_VERSION: 2.7.0
69+
include:
7270
- VERSION: "v4.0"
7371
NETBOX_DOCKER_VERSION: 2.9.1
7472
- VERSION: "v4.1"
7573
NETBOX_DOCKER_VERSION: 3.0.1
74+
- VERSION: "v4.2"
75+
NETBOX_DOCKER_VERSION: 3.1.0
7676

7777
steps:
7878

@@ -101,7 +101,7 @@ jobs:
101101
virtualenvs-create: false
102102

103103
- name: Install Python packages
104-
run: poetry install
104+
run: poetry install --no-root
105105

106106
- name: Build and install collection
107107
run: |

.readthedocs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
version: 2
3-
# sphinx:
4-
# configuration: docs/conf.py
3+
sphinx:
4+
configuration: docs/conf.py
55

66
build:
77
os: ubuntu-22.04

CHANGELOG.rst

+28
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@ NetBox.NetBox Release Notes
44

55
.. contents:: Topics
66

7+
v3.21.0
8+
=======
9+
10+
Minor Changes
11+
-------------
12+
13+
- Add `label`, `description` and `enabled` to `netbox_device_interface_template` (https://github.com/netbox-community/ansible_modules/issues/1333)
14+
- Add example for using ansible variables in lookup
15+
- Add name as option to netbox_fhrp_group
16+
- Add support for custom headers
17+
- netbox_cluster - Add options scope and scope_type for NetBox 4.2+
18+
- netbox_device_interface - Add primary_mac_address option for NetBox 4.2+
19+
- netbox_prefix - Add options scope and scope_type for NetBox 4.2+
20+
- netbox_vm_interface - Add primary_mac_address option for NetBox 4.2+
21+
22+
Bugfixes
23+
--------
24+
25+
- Fix missing netbox_config_template module in module_defaults
26+
- Fixed an isssue with module_default parameter inheritance for modules netbox_config_template, netbox_custom_field_choice_set, netbox_permission, netbox_token, netbox_user, and netbox_user_group.
27+
- fix call /api/status/ instead /api/status in nb_inventory plugin. (https://github.com/netbox-community/ansible_modules/issues/1335).
28+
- netbox_ip_address - Fixed the problem preventing assignment of an IP address to a network interface
29+
30+
New Modules
31+
-----------
32+
33+
- netbox.netbox.netbox_mac_address - Create, update or delete MAC addresses within NetBox
34+
735
v3.20.0
836
=======
937

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This Ansible collection consists of a set of modules to define the intended netw
88
## Requirements
99

1010
- You must be running one of the two most recent releases of NetBox
11-
- A NetBox write-enabled API token when using modules or a read-only token for the `nb_lookup ` and `nb_inventory` plugins.
11+
- A NetBox write-enabled API token when using modules or a read-only token for the `nb_lookup` and `nb_inventory` plugins.
1212
- Python 3.10+
1313
- Python modules:
1414
- pytz
@@ -152,7 +152,7 @@ Customers of NetBox Labs and Ansible using the officially certified version of t
152152
The collection release notes and changelog can be found [here](https://github.com/netbox-community/ansible_modules/releases).
153153

154154
## Related Information
155-
Some extra resources you might find useful for both the Anisble collection and for NetBox itself:
155+
Some extra resources you might find useful for both the Ansible collection and for NetBox itself:
156156
- [NetBox Zero to Hero](https://netboxlabs.com/zero-to-hero/) - free 12 part course that takes you from an empty NetBox through to a fully deployed branch site, using the Ansible collection extensively along the way.
157157
- [Network Configuration Assurance with NetBox and Ansible](https://netboxlabs.com/blog/network-configuration-assurance-with-netbox-and-ansible/) - blog post featuring the Inventory plugin being used in a simple network automation use case to compare actual network state Vs intended state as defined in NetBox.
158158
- Official NetBox [documentation](https://docs.netbox.dev/en/stable/).

changelogs/changelog.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,42 @@ releases:
815815
name: netbox_user_group
816816
namespace: ''
817817
release_date: '2024-09-12'
818+
3.21.0:
819+
changes:
820+
bugfixes:
821+
- Fix missing netbox_config_template module in module_defaults
822+
- Fixed an isssue with module_default parameter inheritance for modules netbox_config_template,
823+
netbox_custom_field_choice_set, netbox_permission, netbox_token, netbox_user,
824+
and netbox_user_group.
825+
- fix call /api/status/ instead /api/status in nb_inventory plugin. (https://github.com/netbox-community/ansible_modules/issues/1335).
826+
- netbox_ip_address - Fixed the problem preventing assignment of an IP address
827+
to a network interface
828+
minor_changes:
829+
- Add `label`, `description` and `enabled` to `netbox_device_interface_template`
830+
(https://github.com/netbox-community/ansible_modules/issues/1333)
831+
- Add example for using ansible variables in lookup
832+
- Add name as option to netbox_fhrp_group
833+
- Add support for custom headers
834+
- netbox_cluster - Add options scope and scope_type for NetBox 4.2+
835+
- netbox_device_interface - Add primary_mac_address option for NetBox 4.2+
836+
- netbox_prefix - Add options scope and scope_type for NetBox 4.2+
837+
- netbox_vm_interface - Add primary_mac_address option for NetBox 4.2+
838+
fragments:
839+
- 1323-fixing-bug-#975.yml
840+
- 1327-add-custom-headers.yml
841+
- 1332-add-hostname_field-option.yml
842+
- 1333-feature-netbox_device_interface_template.yml
843+
- 1335-api-status-page-not-found.yml
844+
- 1339-name-to-fhrp-group.yml
845+
- 1356-add-modules-to-action-groups.yml
846+
- action_groups_config_template.yml
847+
- netbox_mac_address.yml
848+
- scope_prefix_cluster.yml
849+
modules:
850+
- description: Create, update or delete MAC addresses within NetBox
851+
name: netbox_mac_address
852+
namespace: ''
853+
release_date: '2025-03-04'
818854
3.3.0:
819855
changes:
820856
minor_changes:

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
author = "Mikhail Yohman <@FragmentedPacket>"
2828

2929
# The full version, including alpha/beta/rc tags
30-
release = "3.20.0"
30+
release = "3.21.0"
3131

3232

3333
# -- General configuration ---------------------------------------------------

docs/plugins/environment_variables.rst

+7
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ Environment variables used by the ansible-core configuration are documented in :
4444

4545
*Used by:*
4646
:ansplugin:`netbox.netbox.nb\_lookup lookup plugin <netbox.netbox.nb_lookup#lookup>`
47+
.. envvar:: NETBOX_HEADERS
48+
49+
Dictionary of headers to be passed to the NetBox API.
50+
51+
*Used by:*
52+
:ansplugin:`netbox.netbox.nb\_inventory inventory plugin <netbox.netbox.nb_inventory#inventory>`,
53+
:ansplugin:`netbox.netbox.nb\_lookup lookup plugin <netbox.netbox.nb_lookup#lookup>`
4754
.. envvar:: NETBOX_TOKEN
4855

4956
See the documentations for the options where this environment variable is used.

docs/plugins/index.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Netbox.Netbox
88
=============
99

10-
Collection version 3.20.0
10+
Collection version 3.21.0
1111

1212
.. contents::
1313
:local:
@@ -92,6 +92,7 @@ Modules
9292
* :ansplugin:`netbox_l2vpn module <netbox.netbox.netbox_l2vpn#module>` -- Create, update or delete L2VPNs within NetBox
9393
* :ansplugin:`netbox_l2vpn_termination module <netbox.netbox.netbox_l2vpn_termination#module>` -- Create, update or delete L2VPNs terminations within NetBox
9494
* :ansplugin:`netbox_location module <netbox.netbox.netbox_location#module>` -- Create, update or delete locations within NetBox
95+
* :ansplugin:`netbox_mac_address module <netbox.netbox.netbox_mac_address#module>` -- Create, update or delete MAC addresses within NetBox
9596
* :ansplugin:`netbox_manufacturer module <netbox.netbox.netbox_manufacturer#module>` -- Create or delete manufacturers within NetBox
9697
* :ansplugin:`netbox_module module <netbox.netbox.netbox_module#module>` -- Create, update or delete module within NetBox
9798
* :ansplugin:`netbox_module_bay module <netbox.netbox.netbox_module_bay#module>` -- Create, update or delete module bay within NetBox
@@ -184,6 +185,7 @@ Modules
184185
netbox_l2vpn_module
185186
netbox_l2vpn_termination_module
186187
netbox_location_module
188+
netbox_mac_address_module
187189
netbox_manufacturer_module
188190
netbox_module_module
189191
netbox_module_bay_module

docs/plugins/nb_inventory_inventory.rst

+61-11
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ netbox.netbox.nb_inventory inventory -- NetBox inventory source
2222
.. Collection note
2323
2424
.. note::
25-
This inventory plugin is part of the `netbox.netbox collection <https://galaxy.ansible.com/ui/repo/published/netbox/netbox/>`_ (version 3.20.0).
25+
This inventory plugin is part of the `netbox.netbox collection <https://galaxy.ansible.com/ui/repo/published/netbox/netbox/>`_ (version 3.21.0).
2626

2727
It is not included in ``ansible-core``.
2828
To check whether it is installed, run :code:`ansible-galaxy collection list`.
@@ -421,7 +421,7 @@ Parameters
421421

422422
<div class="ansible-option-cell">
423423

424-
Prefix to use for cache plugin files/tables
424+
Prefix to use for cache plugin files/tables.
425425

426426

427427
.. rst-class:: ansible-option-line
@@ -486,7 +486,7 @@ Parameters
486486

487487
<div class="ansible-option-cell">
488488

489-
Cache duration in seconds
489+
Cache duration in seconds.
490490

491491

492492
.. rst-class:: ansible-option-line
@@ -1162,6 +1162,54 @@ Parameters
11621162

11631163
:ansible-option-default-bold:`Default:` :ansible-option-default:`{}`
11641164

1165+
.. raw:: html
1166+
1167+
</div>
1168+
1169+
* - .. raw:: html
1170+
1171+
<div class="ansible-option-cell">
1172+
<div class="ansibleOptionAnchor" id="parameter-headers"></div>
1173+
1174+
.. _ansible_collections.netbox.netbox.nb_inventory_inventory__parameter-headers:
1175+
1176+
.. rst-class:: ansible-option-title
1177+
1178+
**headers**
1179+
1180+
.. raw:: html
1181+
1182+
<a class="ansibleOptionLink" href="#parameter-headers" title="Permalink to this option"></a>
1183+
1184+
.. ansible-option-type-line::
1185+
1186+
:ansible-option-type:`string`
1187+
1188+
1189+
1190+
1191+
.. raw:: html
1192+
1193+
</div>
1194+
1195+
- .. raw:: html
1196+
1197+
<div class="ansible-option-cell">
1198+
1199+
Dictionary of headers to be passed to the NetBox API.
1200+
1201+
1202+
.. rst-class:: ansible-option-line
1203+
1204+
:ansible-option-default-bold:`Default:` :ansible-option-default:`{}`
1205+
1206+
.. rst-class:: ansible-option-line
1207+
1208+
:ansible-option-configuration:`Configuration:`
1209+
1210+
- Environment variable: :envvar:`NETBOX\_HEADERS`
1211+
1212+
11651213
.. raw:: html
11661214

11671215
</div>
@@ -1427,7 +1475,7 @@ Parameters
14271475

14281476
<div class="ansible-option-indent-desc"></div><div class="ansible-option-cell">
14291477

1430-
The key from input dictionary used to generate groups
1478+
The key from input dictionary used to generate groups.
14311479

14321480

14331481
.. raw:: html
@@ -1472,7 +1520,7 @@ Parameters
14721520

14731521
<div class="ansible-option-indent-desc"></div><div class="ansible-option-cell">
14741522

1475-
parent group for keyed group
1523+
parent group for keyed group.
14761524

14771525

14781526
.. raw:: html
@@ -1517,7 +1565,7 @@ Parameters
15171565

15181566
<div class="ansible-option-indent-desc"></div><div class="ansible-option-cell">
15191567

1520-
A keyed group name will start with this prefix
1568+
A keyed group name will start with this prefix.
15211569

15221570

15231571
.. rst-class:: ansible-option-line
@@ -1566,7 +1614,7 @@ Parameters
15661614

15671615
<div class="ansible-option-indent-desc"></div><div class="ansible-option-cell">
15681616

1569-
separator used to build the keyed group name
1617+
separator used to build the keyed group name.
15701618

15711619

15721620
.. rst-class:: ansible-option-line
@@ -1618,7 +1666,7 @@ Parameters
16181666

16191667
<div class="ansible-option-indent-desc"></div><div class="ansible-option-cell">
16201668

1621-
Set this option to :ansval:`False` to omit the :ansopt:`netbox.netbox.nb\_inventory#inventory:keyed\_groups[].separator` after the host variable when the value is an empty string.
1669+
Set this option to :ansval:`false` to omit the :ansopt:`netbox.netbox.nb\_inventory#inventory:keyed\_groups[].separator` after the host variable when the value is an empty string.
16221670

16231671
This option is mutually exclusive with :ansopt:`netbox.netbox.nb\_inventory#inventory:keyed\_groups[].default\_value`.
16241672

@@ -1669,13 +1717,13 @@ Parameters
16691717

16701718
<div class="ansible-option-cell">
16711719

1672-
Use in conjunction with keyed\_groups.
1720+
Use in conjunction with :ansopt:`netbox.netbox.nb\_inventory#inventory:keyed\_groups`.
16731721

16741722
By default, a keyed group that does not have a prefix or a separator provided will have a name that starts with an underscore.
16751723

1676-
This is because the default prefix is "" and the default separator is "\_".
1724+
This is because the default prefix is :ansval:`""` and the default separator is :ansval:`"\_"`.
16771725

1678-
Set this option to False to omit the leading underscore (or other separator) if no prefix is given.
1726+
Set this option to :ansval:`false` to omit the leading underscore (or other separator) if no prefix is given.
16791727

16801728
If the group name is derived from a mapping the separator is still used to concatenate the items.
16811729

@@ -2586,6 +2634,8 @@ Examples
25862634
device_query_filters:
25872635
- has_primary_ip: 'true'
25882636
- tenant__n: internal
2637+
headers:
2638+
Cookie: "{{ auth_cookie }}"
25892639

25902640
# has_primary_ip is a useful way to filter out patch panels and other passive devices
25912641
# Adding '__n' to a field searches for the negation of the value.

0 commit comments

Comments
 (0)