Skip to content

Commit

Permalink
feat: Update provider to work with Netbox 2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
smutel committed Sep 24, 2021
1 parent 7bcff6d commit b4b2512
Show file tree
Hide file tree
Showing 4,325 changed files with 592,618 additions and 293,253 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 3 additions & 3 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go: [ '1.15.x' ]
go: [ '1.16.x' ]
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
Expand All @@ -21,7 +21,7 @@ jobs:
run: git fetch --prune --unshallow

- name: Lint
uses: reviewdog/action-golangci-lint@v1.17.0
uses: reviewdog/action-golangci-lint@v2.0.1
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--config=.golangci.yml"
Expand All @@ -35,7 +35,7 @@ jobs:
shell: bash

- name: Go installation
uses: actions/setup-go@v1.1.3
uses: actions/setup-go@v2.1.4
with:
go-version: ${{ matrix.go }}

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go: [ '1.15.x' ]
go: [ '1.16.x' ]
steps:
- name: Check conventional commits in PR
uses: Namchee/conventional-pr@master
Expand All @@ -20,6 +20,7 @@ jobs:
close: false
template: "Thank you for your contribution attempt in this repository!\n\nUnfortunately, this pull request doesn't meet our standards by reason we stated below.\nFor future pull requests, please use conventional commits.\nPlease update the commits in this PR with conventional commits rules."
strict: false
link_issue: false

- name: Checkout
uses: actions/checkout@v2.3.4
Expand All @@ -28,7 +29,7 @@ jobs:
run: git fetch --prune --unshallow

- name: Lint
uses: reviewdog/action-golangci-lint@v1.17.0
uses: reviewdog/action-golangci-lint@v2.0.1
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--config=.golangci.yml"
Expand All @@ -43,7 +44,7 @@ jobs:
shell: bash

- name: Go installation
uses: actions/setup-go@v1.1.3
uses: actions/setup-go@v2.1.4
with:
go-version: ${{ matrix.go }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go: [ '1.15.x' ]
go: [ '1.16.x' ]
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
Expand All @@ -21,13 +21,13 @@ jobs:
run: git fetch --prune --unshallow

- name: Go installation
uses: actions/setup-go@v1.1.3
uses: actions/setup-go@v2.1.4
with:
go-version: ${{ matrix.go }}

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v3.1.0
uses: crazy-max/ghaction-import-gpg@v4.0.0
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
Expand Down
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ Terraform provider for [Netbox.](https://netbox.readthedocs.io/en/stable/)

* A libc library like libc6-compat or libc-utils
* General developer tools like make, bash, ... (to build the provider)
* Go 1.15 minimum (to build the provider)
* Go 1.16 minimum (to build the provider)
* Terraform (to use the provider)

## Compatibility with Netbox

Version 0.x.y => Netbox 2.8
Version 1.x.y => Netbox 2.9
| Netbox version | Provider version |
|:--------------:|:----------------:|
| 2.8 | 0.x.y |
| 2.9 | 1.x.y |
| 2.11 | 2.x.y |

## Building the provider

Expand Down Expand Up @@ -123,11 +126,3 @@ $ export NETBOX_SCHEME="http"
$ cd examples
$ terraform init & terraform apply
```
## Known bugs in external project which can impact this provider

* *Closed* - [Issue 85 in project go-netbox](https://github.com/netbox-community/go-netbox/issues/85)
* *Closed* - [Issue 54 in project go-netbox](https://github.com/netbox-community/go-netbox/issues/54)
* *Open* - [Issue 115 in project go-netbox](https://github.com/netbox-community/go-netbox/issues/115)
* *Closed* - [Issue 100 in project go-netbox](https://github.com/netbox-community/go-netbox/issues/100)
- json: cannot unmarshal number into Go struct field \<field\>.results.connected_endpoint of type string
- Currently causes issues for Circuits/CircuitTerminations, DCIM/Cables, DCIM/Interfaces, and Extras/ObjectChanges
24 changes: 0 additions & 24 deletions docs/data-sources/json_dcim_rack_groups_list.md

This file was deleted.

24 changes: 0 additions & 24 deletions docs/data-sources/json_extras_graphs_list.md

This file was deleted.

61 changes: 46 additions & 15 deletions docs/resources/ipam_aggregate.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,64 @@ resource "netbox_ipam_aggregate" "aggregate_test" {
slug = "tag1"
}
custom_fields = {
cf_boolean = "true"
cf_date = "2020-12-25"
cf_integer = "10"
cf_selection = "1"
cf_text = "Some text"
cf_url = "https://github.com"
custom_field {
name = "cf_boolean"
type = "boolean"
value = "true"
}
custom_field {
name = "cf_date"
type = "date"
value = "2020-12-25"
}
custom_field {
name = "cf_text"
type = "text"
value = "some text"
}
custom_field {
name = "cf_integer"
type = "integer"
value = "10"
}
custom_field {
name = "cf_selection"
type = "selection"
value = "1"
}
custom_field {
name = "cf_url"
type = "url"
value = "https://github.com"
}
custom_field {
name = "cf_multiple_selection"
type = "multiple"
value = "0,1"
}
}
```

## Argument Reference

The following arguments are supported:
* ``custom_fields`` - (Optional) Custom Field Keys and Values for this object
* For boolean, use the string value "true" or "false"
* For data, use the string format "YYYY-MM-DD"
* For integer, use the value between double quote "10"
* For selection, use the level id
* For text, use the string value
* For URL, use the URL as string
* ``date_added`` - (Optional) Date when this aggregate was added. Format *YYYY-MM-DD*.
* ``description`` - (Optional) The description of this object.
* ``prefix`` - (Required) The prefix (with mask) used for this object.
* ``rir_id`` - (Required) The RIR id linked to this object.

The ``tag`` block supports:
The ``custom_field`` block (optional) supports:
* ``name`` - (Required) Name of the existing custom resource to associate with this resource.
* ``type`` - (Required) Type of the existing custom resource to associate with this resource (text, integer, boolean, url, selection, multiple).
* ``value`` - (Required) Value of the existing custom resource to associate with this resource.

The ``tag`` block (optional) supports:
* ``name`` - (Required) Name of the existing tag to associate with this resource.
* ``slug`` - (Required) Slug of the existing tag to associate with this resource.

Expand Down
62 changes: 46 additions & 16 deletions docs/resources/ipam_ip_addresses.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,46 @@ resource "netbox_ipam_ip_addresses" "ip_test" {
slug = "tag1"
}
custom_fields = {
cf_boolean = "true"
cf_date = "2020-12-25"
cf_integer = "10"
cf_selection = "1"
cf_text = "Some text"
cf_url = "https://github.com"
custom_field {
name = "cf_boolean"
type = "boolean"
value = "true"
}
custom_field {
name = "cf_date"
type = "date"
value = "2020-12-25"
}
custom_field {
name = "cf_text"
type = "text"
value = "some text"
}
custom_field {
name = "cf_integer"
type = "integer"
value = "10"
}
custom_field {
name = "cf_selection"
type = "selection"
value = "1"
}
custom_field {
name = "cf_url"
type = "url"
value = "https://github.com"
}
custom_field {
name = "cf_multiple_selection"
type = "multiple"
value = "0,1"
}
}
```
Expand All @@ -30,17 +63,9 @@ resource "netbox_ipam_ip_addresses" "ip_test" {

The following arguments are supported:
* ``address`` - (Required) The IP address (with mask) used for this object.
* ``custom_fields`` - (Optional) Custom Field Keys and Values for this object
* For boolean, use the string value "true" or "false"
* For data, use the string format "YYYY-MM-DD"
* For integer, use the value between double quote "10"
* For selection, use the level id
* For text, use the string value
* For URL, use the URL as string
* ``description`` - (Optional) The description of this object.
* ``dns_name`` - (Optional) The DNS name of this object.
* ``nat_inside_id`` - (Optional) The ID of the NAT inside of this object.
* ``nat_outside_id`` - (Optional) The ID of the NAT outside of this object.
* ``object_id`` - (Optional) The ID of the object where this resource is attached to.
* ``object_type`` - (Optional) The object type among virtualization.vminterface
or dcim.interface (virtualization.vminterface by default)
Expand All @@ -50,7 +75,12 @@ or dcim.interface (virtualization.vminterface by default)
* ``tenant_id`` - (Optional) ID of the tenant where this object is attached.
* ``vrf_id`` - (Optional) The ID of the vrf attached to this object.

The ``tag`` block supports:
The ``custom_field`` block (optional) supports:
* ``name`` - (Required) Name of the existing custom resource to associate with this resource.
* ``type`` - (Required) Type of the existing custom resource to associate with this resource (text, integer, boolean, url, selection, multiple).
* ``value`` - (Required) Value of the existing custom resource to associate with this resource.

The ``tag`` block (optional) supports:
* ``name`` - (Required) Name of the existing tag to associate with this resource.
* ``slug`` - (Required) Slug of the existing tag to associate with this resource.

Expand Down

0 comments on commit b4b2512

Please sign in to comment.