Skip to content

Commit

Permalink
Merge branch 'master' into feature/netbox_device_custom_fields
Browse files Browse the repository at this point in the history
  • Loading branch information
fbreckle authored Nov 16, 2022
2 parents 8303a32 + af7362d commit 00db9d9
Show file tree
Hide file tree
Showing 120 changed files with 2,984 additions and 221 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
- uses: actions/cache@v3
with:
path: |
Expand All @@ -25,6 +25,9 @@ jobs:
strategy:
matrix:
netbox-version:
- "v3.3.7"
- "v3.3.6"
- "v3.3.5"
- "v3.3.4"
- "v3.3.3"
- "v3.3.2"
Expand All @@ -34,7 +37,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
- uses: actions/cache@v3
with:
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
- name: Import GPG key
id: import_gpg
uses: paultyng/[email protected]
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3.1.0
uses: goreleaser/goreleaser-action@v3.2.0
with:
version: latest
args: release --rm-dist
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.dll
*.exe
.envrc
.DS_Store
example.tf
terraform.tfplan
Expand Down
68 changes: 67 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,69 @@
## 3.0.8 (November 9th, 2022)

ENHANCEMENTS

* **New Resource:** `netbox_device_interface` ([#286](https://github.com/e-breuninger/terraform-provider-netbox/pull/286) by [@arjenvri](https://github.com/arjenvri))
* **New Data Source:** `netbox_asn` ([#285](https://github.com/e-breuninger/terraform-provider-netbox/pull/285) by [@kyle-burnett](https://github.com/kyle-burnett))
* **New Data Source:** `netbox_asns` ([#292](https://github.com/e-breuninger/terraform-provider-netbox/pull/292) by [@kyle-burnett](https://github.com/kyle-burnett))
* data-source/netbox_prefix: Add `tags` and tag filter attributes ([#284](https://github.com/e-breuninger/terraform-provider-netbox/pull/284) by [@kyle-burnett](https://github.com/kyle-burnett))

BUG FIXES
* data-source/netbox_prefixes: FIx kernel panic when finding prefixes without vlan or vrf

## 3.0.7 (November 3rd, 2022)

ENHANCEMENTS

* **New Resource:** `netbox_contact_role` ([#279](https://github.com/e-breuninger/terraform-provider-netbox/pull/279) by [@arjenvri](https://github.com/arjenvri))
* **New Resource:** `netbox_contact_assignment` ([#279](https://github.com/e-breuninger/terraform-provider-netbox/pull/279) by [@arjenvri](https://github.com/arjenvri))
* resource/netbox_device: Add `primary_ipv6` attribute ([#282](https://github.com/e-breuninger/terraform-provider-netbox/pull/282) by [@arjenvri](https://github.com/arjenvri))
* resource/netbox_virtual_machine: Add `primary_ipv6` attribute ([#283](https://github.com/e-breuninger/terraform-provider-netbox/pull/283) by [@arjenvri](https://github.com/arjenvri))
* resource/netbox_custom_field: Add `group_name` atribute ([#280](https://github.com/e-breuninger/terraform-provider-netbox/pull/280) by [@arjenvri](https://github.com/arjenvri))

## 3.0.6 (October 21st, 2022)

ENHANCEMENTS

* **New Resource:** `netbox_contact` ([#273](https://github.com/e-breuninger/terraform-provider-netbox/pull/273) by [@arjenvri](https://github.com/arjenvri))
* data-source/netbox_prefix: Add `description` attribute ([#277](https://github.com/e-breuninger/terraform-provider-netbox/pull/277) by [@holmesb](https://github.com/holmesb))
* resource/netbox_cluster: Add `tenant_id` attribute ([#275](https://github.com/e-breuninger/terraform-provider-netbox/pull/275) by [@arjenvri](https://github.com/arjenvri))

## 3.0.5 (October 18th, 2022)

ENHANCEMENTS

* resource/netbox_device_role: Add `tags` attribute ([#269](https://github.com/e-breuninger/terraform-provider-netbox/pull/269) by [@hollow](https://github.com/hollow))
* data-source/netbox_device_role: Add `tags` attribute ([#269](https://github.com/e-breuninger/terraform-provider-netbox/pull/269) by [@hollow](https://github.com/hollow))

CHANGES

* resource/netbox_service: Implement provider-side validation on allowed values. Valid values are `tcp`, `udp` and `sctp`.

## 3.0.4 (October 11th, 2022)

ENHANCEMENTS

* resource/netbox_device: Add `platform_id` attribute ([#264](https://github.com/e-breuninger/terraform-provider-netbox/pull/264) by [@mifrost](https://github.com/mifrost))
* **New Data Source:** `netbox_prefixes ` ([#253](https://github.com/e-breuninger/terraform-provider-netbox/pull/253) by [@ironashram](https://github.com/ironashram))
* data-source/netbox_prefix: Add `prefix`, `status`, `vlan_id`, `vlan_vid` attributes ([#253](https://github.com/e-breuninger/terraform-provider-netbox/pull/253) by [@ironashram](https://github.com/ironashram))
* resource/netbox_device: Add `status` attribute [#266](https://github.com/e-breuninger/terraform-provider-netbox/pull/266) by [@mifrost](https://github.com/mifrost))

CHANGES

* resource/netbox_prefix: Deprecate `cidr` attribute in favor of new canonical `prefix` attribute

## 3.0.3 (October 4th, 2022)

ENHANCEMENTS

* resource/netbox_site: Add `group_id` attribute ([#255](https://github.com/e-breuninger/terraform-provider-netbox/pull/255) by [@arjenvri](https://github.com/arjenvri))

## 3.0.2 (September 30th, 2022)

ENHANCEMENTS

* data-source/netbox_cluster: Add `site_id`, `cluster_type_id`, `cluster_group_id` and `tags` attribute ([#251](https://github.com/e-breuninger/terraform-provider-netbox/pull/251) by [@ns1pelle](https://github.com/ns1pelle))

## 3.0.1 (September 25th, 2022)

This is a re-release of 3.0.0 because there seem to be some issues with the checksums in the 3.0.0 version.
Expand All @@ -22,7 +88,7 @@ ENHANCEMENTS

* **New Data Source:** `netbox_devices` ([#236](https://github.com/e-breuninger/terraform-provider-netbox/pull/236) by [@dipeshsharma](https://github.com/dipeshsharma))
* provider: Add `request_timeout` attribute ([#227](https://github.com/e-breuninger/terraform-provider-netbox/pull/227) by [@twink0r](https://github.com/twink0r))
* data-source/netbox-tenants: Added `limit` attribute to allow for larger queries
* data-source/netbox_tenants: Add `limit` attribute to allow for larger queries

## 2.0.6 (September 9th, 2022)

Expand Down
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ TEST?=netbox/*.go
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
DOCKER_COMPOSE=docker-compose

export NETBOX_VERSION=v3.3.4
export NETBOX_VERSION=v3.3.7
export NETBOX_SERVER_URL=http://localhost:8001
export NETBOX_API_TOKEN=0123456789abcdef0123456789abcdef01234567
export NETBOX_TOKEN=$(NETBOX_API_TOKEN)
Expand Down
44 changes: 44 additions & 0 deletions docs/data-sources/asn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# generated by https://github.com/fbreckle/terraform-plugin-docs
page_title: "netbox_asn Data Source - terraform-provider-netbox"
subcategory: "IP Address Management (IPAM)"
description: |-
---

# netbox_asn (Data Source)



## Example Usage

```terraform
data "netbox_asn" "asn_1" {
asn = "1111"
tag = "tag-1"
}
data "netbox_asn" "asn_2" {
tag = "tag-1"
tag__n = "tag-2"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `asn` (String) At least one of `asn` or `tag` must be given.
- `tag` (String) Tag to include in the data source filter (must match the tag's slug). At least one of `asn` or `tag` must be given.
- `tag__n` (String) Tag to exclude from the data source filter (must match the tag's slug).
Refer to [Netbox's documentation](https://demo.netbox.dev/static/docs/rest-api/filtering/#lookup-expressions)
for more information on available lookup expressions.

### Read-Only

- `description` (String)
- `id` (Number) The ID of this resource.
- `tags` (Set of String)


60 changes: 60 additions & 0 deletions docs/data-sources/asns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
# generated by https://github.com/fbreckle/terraform-plugin-docs
page_title: "netbox_asns Data Source - terraform-provider-netbox"
subcategory: "IP Address Management (IPAM)"
description: |-
---

# netbox_asns (Data Source)



## Example Usage

```terraform
data "netbox_asns" "asns" {
filter {
name = "asn__gte"
value = "1000"
}
filter {
name = "asn__lte"
value = "2000"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `filter` (Block Set) (see [below for nested schema](#nestedblock--filter))
- `limit` (Number) Defaults to `0`.

### Read-Only

- `asns` (List of Object) (see [below for nested schema](#nestedatt--asns))
- `id` (String) The ID of this resource.

<a id="nestedblock--filter"></a>
### Nested Schema for `filter`

Required:

- `name` (String)
- `value` (String)


<a id="nestedatt--asns"></a>
### Nested Schema for `asns`

Read-Only:

- `asn` (Number)
- `id` (Number)
- `rir_id` (Number)
- `tags` (Set of String)


4 changes: 4 additions & 0 deletions docs/data-sources/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ data "netbox_cluster" "vmw_cluster_01" {

### Read-Only

- `cluster_group_id` (Number)
- `cluster_id` (Number)
- `cluster_type_id` (Number)
- `id` (String) The ID of this resource.
- `site_id` (Number)
- `tags` (Set of String)


1 change: 1 addition & 0 deletions docs/data-sources/device_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ data "netbox_device_role" "core_sw" {
- `color_hex` (String)
- `id` (String) The ID of this resource.
- `slug` (String)
- `tags` (Set of String)


14 changes: 12 additions & 2 deletions docs/data-sources/prefix.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,21 @@ description: |-

### Optional

- `cidr` (String)
- `vrf_id` (Number)
- `cidr` (String, Deprecated) At least one of `description`, `prefix`, `vlan_vid`, `vrf_id`, `vlan_id`, `cidr` or `tag` must be given. Conflicts with `prefix`.
- `description` (String) Description to include in the data source filter. At least one of `description`, `prefix`, `vlan_vid`, `vrf_id`, `vlan_id`, `cidr` or `tag` must be given.
- `prefix` (String) At least one of `description`, `prefix`, `vlan_vid`, `vrf_id`, `vlan_id`, `cidr` or `tag` must be given. Conflicts with `cidr`.
- `tag` (String) Tag to include in the data source filter (must match the tag's slug). At least one of `description`, `prefix`, `vlan_vid`, `vrf_id`, `vlan_id`, `cidr` or `tag` must be given.
- `tag__n` (String) Tag to exclude from the data source filter (must match the tag's slug).
Refer to [Netbox's documentation](https://demo.netbox.dev/static/docs/rest-api/filtering/#lookup-expressions)
for more information on available lookup expressions.
- `vlan_id` (Number) At least one of `description`, `prefix`, `vlan_vid`, `vrf_id`, `vlan_id`, `cidr` or `tag` must be given.
- `vlan_vid` (Number) At least one of `description`, `prefix`, `vlan_vid`, `vrf_id`, `vlan_id`, `cidr` or `tag` must be given.
- `vrf_id` (Number) At least one of `description`, `prefix`, `vlan_vid`, `vrf_id`, `vlan_id`, `cidr` or `tag` must be given.

### Read-Only

- `id` (Number) The ID of this resource.
- `status` (String)
- `tags` (Set of String)


49 changes: 49 additions & 0 deletions docs/data-sources/prefixes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
# generated by https://github.com/fbreckle/terraform-plugin-docs
page_title: "netbox_prefixes Data Source - terraform-provider-netbox"
subcategory: "IP Address Management (IPAM)"
description: |-
---

# netbox_prefixes (Data Source)





<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `filter` (Block Set) (see [below for nested schema](#nestedblock--filter))
- `limit` (Number) Defaults to `0`.

### Read-Only

- `id` (String) The ID of this resource.
- `prefixes` (List of Object) (see [below for nested schema](#nestedatt--prefixes))

<a id="nestedblock--filter"></a>
### Nested Schema for `filter`

Required:

- `name` (String)
- `value` (String)


<a id="nestedatt--prefixes"></a>
### Nested Schema for `prefixes`

Read-Only:

- `id` (Number)
- `prefix` (String)
- `status` (String)
- `vlan_id` (Number)
- `vlan_vid` (Number)
- `vrf_id` (Number)


1 change: 1 addition & 0 deletions docs/data-sources/tenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ data "netbox_tenant" "customer_a" {

### Optional

- `description` (String)
- `name` (String) At least one of `name` or `slug` must be given.
- `slug` (String) At least one of `name` or `slug` must be given.

Expand Down
20 changes: 14 additions & 6 deletions docs/data-sources/vlan.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ data "netbox_vlan" "vlan1" {
name = "vlan-1"
}
# Get VLAN by VLAN ID
# Get VLAN by VID and IPAM role ID
data "netbox_vlan" "vlan2" {
vid = 1234
vid = 1234
role = netbox_ipam_role.example.id
}
# Get VLAN by name and tenant ID
data "netbox_vlan" "vlan3" {
name = "vlan-3"
tenant = netbox_tenant.example.id
}
```

Expand All @@ -29,16 +36,17 @@ data "netbox_vlan" "vlan2" {

### Optional

- `name` (String) At least one of `name` or `vid` must be given.
- `vid` (Number) At least one of `name` or `vid` must be given.
- `group_id` (Number)
- `name` (String)
- `role` (Number)
- `tenant` (Number)
- `vid` (Number)

### Read-Only

- `description` (String)
- `id` (String) The ID of this resource.
- `role` (Number)
- `site` (Number)
- `status` (String)
- `tenant` (Number)


1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Netbox often makes breaking API changes even in non-major releases. Check the ta

Provider version | Netbox version
--- | ---
v3.0.x | v3.3.0 and up
v2.0.x | v3.2.0 and up
v1.6.x and up| v3.1.9
v1.1.x and up | v3.1.3
Expand Down
Loading

0 comments on commit 00db9d9

Please sign in to comment.