Skip to content

Commit

Permalink
feat: Add netbox_dcim_device_role resource
Browse files Browse the repository at this point in the history
  • Loading branch information
amhn committed Nov 18, 2022
1 parent f214f6a commit b250d1e
Show file tree
Hide file tree
Showing 6 changed files with 534 additions and 6 deletions.
9 changes: 8 additions & 1 deletion examples/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
resource "netbox_dcim_device_role" "device_role_test" {
name = "Test device role"
slug = "Test device role"
description = "Device role for testing"
color = "00ff00"
}

resource "netbox_tenancy_tenant" "tenant_test" {
name = "Test_Tenant"
slug = "Test_Tenant"
Expand Down Expand Up @@ -542,7 +549,7 @@ resource "netbox_virtualization_vm" "vm_test" {
vcpus = 2
platform_id = data.netbox_dcim_platform.platform_test.id
tenant_id = netbox_tenancy_tenant.tenant_test.id
role_id = 1
role_id = netbox_dcim_device_role.device_role_test.id
local_context_data = jsonencode(
{
hello = "world"
Expand Down
83 changes: 83 additions & 0 deletions examples/resources/netbox_dcim_device_role/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
resource "netbox_dcim_device_role" "device_role_test" {
name = "Test device role"
slug = "Test device role"
description = "Device role for testing"
color = "00ff00"

tag {
name = "tag1"
slug = "tag1"
}

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 = "select"
value = "1"
}

custom_field {
name = "cf_url"
type = "url"
value = "https://github.com"
}

custom_field {
name = "cf_multi_selection"
type = "multiselect"
value = jsonencode([
"0",
"1"
])
}

custom_field {
name = "cf_json"
type = "json"
value = jsonencode({
stringvalue = "string"
boolvalue = false
dictionary = {
numbervalue = 5
}
})
}

custom_field {
name = "cf_object"
type = "object"
value = 1
}

custom_field {
name = "cf_multi_object"
type = "multiobject"
value = jsonencode([
1,
2
])
}
}
Loading

0 comments on commit b250d1e

Please sign in to comment.