CiscoISE / terraform-provider-ciscoise

Terraform Provider for Cisco ISE
https://registry.terraform.io/providers/CiscoISE/ciscoise/latest/docs
MIT License
10 stars 4 forks source link

Cannot register a dedicated PSN node using the 'node_deployment' resource #60

Closed aussietexan closed 2 years ago

aussietexan commented 2 years ago

Environment: ISE version and patch: ISE 3.1 patch 3 Terraform version: 1.3.1 ISE provider version: 0.6.8-beta OS version: MacOS 12.6

Describe the bug When registering a dedicated PSN, the 'roles' parameter is not applicable. When using the OpenAPI for this operation, the 'roles' parameter is removed from the body and the 'services' parameters are included as required. When trying to use this resource without the 'roles' parameter or using ("") or ("null") for the value, the following error is returned:

│ error with operation RegisterNode
│ {
│   "message" : "request has bad input format in the body",
│   "code" : 400
│ }

Expected behavior The 'roles' parameter should be optional, depending on the type of node/persona being registered. The same should be the case for the 'services' parameter as a dedicated PAN/MNT/PXG node would not have these services enabled.

Successful API call body for registering a dedicated PSN

{
  "allowCertImport": false,
  "fqdn": "ise31-2.ise.trappedunderise.com",
  "password": "redacted",
  "services": [
    "Session",
    "Profiler",
    "DeviceAdmin"
  ],
  "userName": "admin"
}

200 response from API call

{
    "success": {
        "message": "Node was registered successfully.Node was registered successfully. Data will be sync'ed to the node, and then the application server will be restarted on the node.  This processing may take several minutes to complete. When failover is required among multiple PSNs, please put the nodes in a Node Group"
    },
    "version": "1.0.0"
}

Additional context The documentation should also define the supported parameter values for 'roles' and 'services' as per the API documentation: https://developer.cisco.com/docs/identity-services-engine/v1/#!deployment-openapi

fmunozmiranda commented 2 years ago

Hello @aussietexan, try it again with new version (0.6.9-beta) and let us know if it works for you

aussietexan commented 2 years ago

Hi @fmunozmiranda. I tried the following resource block syntax with the new version (0.6.9-beta) and get the same 400 error code. I tried removing the 'roles' parameter, using "" or "null" for the parameter value, but get the same error. What syntax is meant to work for the empty role value?

resource "ciscoise_node_deployment" "join-ise31-2" {
  provider = ciscoise.ise31-1
  parameters {

    allow_cert_import = "false"
    fqdn              = "ise31-2.ise.trappedunderise.com"
    hostname          = "ise31-2"
    password          = var.ise-password
    roles             = [""]
    services  = ["Services", "Profiler", "DeviceAdmin"]
    user_name = "admin"
  }
}
fmunozmiranda commented 2 years ago

@aussietexan API error message it's the same? Can you check with DEBUG if request body that terraform is sending it`s ok?

aussietexan commented 2 years ago

Hi @fmunozmiranda. Here is the output from 'terraform apply' with the 'roles' parameter removed in the resource block and debug enabled.

+ terraform apply --auto-approve

Terraform used the selected providers to generate the following execution plan.
Resource actions are indicated with the following symbols:
  + create
 <= read (data resources)

Terraform will perform the following actions:

  # data.ciscoise_node_deployment.ise31-2-status will be read during apply
  # (depends on a resource or a module with changes pending)
 <= data "ciscoise_node_deployment" "ise31-2-status" {
      + hostname = "ise31-2"
      + id       = (known after apply)
      + item     = (known after apply)
      + items    = (known after apply)
    }

  # ciscoise_node_deployment.join-ise31-2 will be created
  + resource "ciscoise_node_deployment" "join-ise31-2" {
      + id           = (known after apply)
      + item         = (known after apply)
      + last_updated = (known after apply)

      + parameters {
          + allow_cert_import = "false"
          + fqdn              = "ise31-2.ise.domain.com"
          + hostname          = "ise31-2"
          + ip_address        = (known after apply)
          + node_status       = (known after apply)
          + password          = (sensitive value)
          + roles             = (known after apply)
          + services          = [
              + "Services",
              + "Profiler",
              + "DeviceAdmin",
            ]
          + user_name         = "admin"
        }
    }

  # time_sleep.wait-15-minutes will be created
  + resource "time_sleep" "wait-15-minutes" {
      + create_duration = "15m"
      + id              = (known after apply)
    }

Plan: 2 to add, 0 to change, 0 to destroy.

Changes to Outputs:
  + ciscoise_node_deployment_example = (known after apply)
ciscoise_node_deployment.join-ise31-2: Creating...
â•·
│ Error: Failure when executing RegisterNode
│ 
│   with ciscoise_node_deployment.join-ise31-2,
│   on main.tf line 23, in resource "ciscoise_node_deployment" "join-ise31-2":
│   23: resource "ciscoise_node_deployment" "join-ise31-2" {
│ 
│ error with operation RegisterNode
│ {
│   "message" : "request has bad input format in the body",
│   "code" : 400
│ }
╵
fmunozmiranda commented 2 years ago

@aussietexan Could you please active debug and send me the answer?

Active debug: export ISE_DEBUG = "true" export TF_LOG = "DEBUG"

aussietexan commented 2 years ago

2022-10-20T08:25:18.267+1100 [INFO]  Terraform version: 1.3.2
2022-10-20T08:25:18.268+1100 [DEBUG] using github.com/hashicorp/go-tfe v1.9.0
2022-10-20T08:25:18.268+1100 [DEBUG] using github.com/hashicorp/hcl/v2 v2.14.1
2022-10-20T08:25:18.268+1100 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2
2022-10-20T08:25:18.268+1100 [DEBUG] using github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
2022-10-20T08:25:18.268+1100 [DEBUG] using github.com/zclconf/go-cty v1.11.0
2022-10-20T08:25:18.268+1100 [INFO]  Go runtime version: go1.19.1
2022-10-20T08:25:18.269+1100 [INFO]  CLI args: []string{"terraform", "apply", "--auto-approve"}
2022-10-20T08:25:18.269+1100 [DEBUG] Attempting to open CLI config file: /home/grgibbs/.terraformrc
2022-10-20T08:25:18.269+1100 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2022-10-20T08:25:18.269+1100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2022-10-20T08:25:18.269+1100 [DEBUG] ignoring non-existing provider search directory /home/grgibbs/.terraform.d/plugins
2022-10-20T08:25:18.270+1100 [DEBUG] ignoring non-existing provider search directory /home/grgibbs/.local/share/terraform/plugins
2022-10-20T08:25:18.270+1100 [DEBUG] ignoring non-existing provider search directory /home/grgibbs/.local/share/flatpak/exports/share/terraform/plugins
2022-10-20T08:25:18.270+1100 [DEBUG] ignoring non-existing provider search directory /var/lib/flatpak/exports/share/terraform/plugins
2022-10-20T08:25:18.270+1100 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2022-10-20T08:25:18.270+1100 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2022-10-20T08:25:18.271+1100 [INFO]  CLI command args: []string{"apply", "--auto-approve"}
2022-10-20T08:25:18.272+1100 [DEBUG] New state was assigned lineage "3a2ecf57-c41a-17cf-b613-fcf2ac864bab"
2022-10-20T08:25:18.477+1100 [DEBUG] checking for provisioner in "."
2022-10-20T08:25:18.487+1100 [DEBUG] checking for provisioner in "/usr/bin"
2022-10-20T08:25:18.488+1100 [INFO]  backend/local: starting Apply operation
2022-10-20T08:25:18.489+1100 [DEBUG] created provider logger: level=debug
2022-10-20T08:25:18.490+1100 [INFO]  provider: configuring client automatic mTLS
2022-10-20T08:25:18.511+1100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta args=[.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta]
2022-10-20T08:25:18.511+1100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta pid=3469
2022-10-20T08:25:18.511+1100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta
2022-10-20T08:25:18.519+1100 [INFO]  provider.terraform-provider-ciscoise_v0.6.9-beta: configuring server automatic mTLS: timestamp=2022-10-20T08:25:18.518+1100
2022-10-20T08:25:18.539+1100 [DEBUG] provider.terraform-provider-ciscoise_v0.6.9-beta: plugin address: network=unix address=/tmp/plugin3865802774 timestamp=2022-10-20T08:25:18.539+1100
2022-10-20T08:25:18.539+1100 [DEBUG] provider: using plugin: version=5
2022-10-20T08:25:18.660+1100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2022-10-20T08:25:18.665+1100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta pid=3469
2022-10-20T08:25:18.665+1100 [DEBUG] provider: plugin exited
2022-10-20T08:25:18.665+1100 [DEBUG] Building and walking validate graph
2022-10-20T08:25:18.666+1100 [DEBUG] ProviderTransformer: "ciscoise_node_deployment.join-ise31-2" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/ciscoise/ciscoise"].ise31-1
2022-10-20T08:25:18.666+1100 [DEBUG] pruning unused provider["registry.terraform.io/ciscoise/ciscoise"]
2022-10-20T08:25:18.666+1100 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/ciscoise/ciscoise\"].ise31-1" references: []
2022-10-20T08:25:18.666+1100 [DEBUG] ReferenceTransformer: "ciscoise_node_deployment.join-ise31-2" references: [var.ise-password]
2022-10-20T08:25:18.667+1100 [DEBUG] ReferenceTransformer: "var.ise-password" references: []
2022-10-20T08:25:18.667+1100 [DEBUG] Starting graph walk: walkValidate
2022-10-20T08:25:18.667+1100 [DEBUG] created provider logger: level=debug
2022-10-20T08:25:18.668+1100 [INFO]  provider: configuring client automatic mTLS
2022-10-20T08:25:18.676+1100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta args=[.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta]
2022-10-20T08:25:18.677+1100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta pid=3476
2022-10-20T08:25:18.677+1100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta
2022-10-20T08:25:18.684+1100 [INFO]  provider.terraform-provider-ciscoise_v0.6.9-beta: configuring server automatic mTLS: timestamp=2022-10-20T08:25:18.684+1100
2022-10-20T08:25:18.704+1100 [DEBUG] provider.terraform-provider-ciscoise_v0.6.9-beta: plugin address: address=/tmp/plugin3947636974 network=unix timestamp=2022-10-20T08:25:18.703+1100
2022-10-20T08:25:18.704+1100 [DEBUG] provider: using plugin: version=5
2022-10-20T08:25:18.875+1100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2022-10-20T08:25:18.884+1100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta pid=3476
2022-10-20T08:25:18.884+1100 [DEBUG] provider: plugin exited
2022-10-20T08:25:18.884+1100 [DEBUG] created provider logger: level=debug
2022-10-20T08:25:18.884+1100 [INFO]  provider: configuring client automatic mTLS
2022-10-20T08:25:18.892+1100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/time/0.9.0/linux_amd64/terraform-provider-time_v0.9.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/time/0.9.0/linux_amd64/terraform-provider-time_v0.9.0_x5]
2022-10-20T08:25:18.893+1100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/time/0.9.0/linux_amd64/terraform-provider-time_v0.9.0_x5 pid=3484
2022-10-20T08:25:18.893+1100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/time/0.9.0/linux_amd64/terraform-provider-time_v0.9.0_x5
2022-10-20T08:25:18.899+1100 [INFO]  provider.terraform-provider-time_v0.9.0_x5: configuring server automatic mTLS: timestamp=2022-10-20T08:25:18.899+1100
2022-10-20T08:25:18.918+1100 [DEBUG] provider: using plugin: version=5
2022-10-20T08:25:18.918+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: plugin address: address=/tmp/plugin2357003364 network=unix timestamp=2022-10-20T08:25:18.918+1100
2022-10-20T08:25:18.950+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Calling provider defined Provider Metadata: tf_provider_addr=registry.terraform.io/hashicorp/time tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd tf_rpc=GetProviderSchema @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server_getproviderschema.go:39 @module=sdk.framework timestamp=2022-10-20T08:25:18.949+1100
2022-10-20T08:25:18.950+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Called provider defined Provider Metadata: tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd tf_rpc=GetProviderSchema @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server_getproviderschema.go:41 @module=sdk.framework tf_provider_addr=registry.terraform.io/hashicorp/time timestamp=2022-10-20T08:25:18.949+1100
2022-10-20T08:25:18.950+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Calling provider defined Provider GetSchema: tf_rpc=GetProviderSchema @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server.go:260 @module=sdk.framework tf_provider_addr=registry.terraform.io/hashicorp/time tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd timestamp=2022-10-20T08:25:18.950+1100
2022-10-20T08:25:18.950+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Called provider defined Provider GetSchema: tf_provider_addr=registry.terraform.io/hashicorp/time tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd tf_rpc=GetProviderSchema @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server.go:262 @module=sdk.framework timestamp=2022-10-20T08:25:18.950+1100
2022-10-20T08:25:18.950+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Calling provider defined Provider Resources: tf_provider_addr=registry.terraform.io/hashicorp/time tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd tf_rpc=GetProviderSchema @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server.go:330 @module=sdk.framework timestamp=2022-10-20T08:25:18.950+1100
2022-10-20T08:25:18.950+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Called provider defined Provider Resources: tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd tf_rpc=GetProviderSchema @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server.go:332 @module=sdk.framework tf_provider_addr=registry.terraform.io/hashicorp/time timestamp=2022-10-20T08:25:18.950+1100
2022-10-20T08:25:18.951+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Calling provider defined Resource GetSchema: @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server.go:411 tf_provider_addr=registry.terraform.io/hashicorp/time tf_rpc=GetProviderSchema @module=sdk.framework tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd tf_resource_type=time_rotating timestamp=2022-10-20T08:25:18.950+1100
2022-10-20T08:25:18.951+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Called provider defined Resource GetSchema: tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd tf_provider_addr=registry.terraform.io/hashicorp/time tf_resource_type=time_rotating tf_rpc=GetProviderSchema @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server.go:413 @module=sdk.framework timestamp=2022-10-20T08:25:18.950+1100
2022-10-20T08:25:18.951+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Calling provider defined Resource GetSchema: tf_rpc=GetProviderSchema @module=sdk.framework tf_provider_addr=registry.terraform.io/hashicorp/time @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server.go:411 tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd tf_resource_type=time_sleep timestamp=2022-10-20T08:25:18.950+1100
2022-10-20T08:25:18.952+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Called provider defined Resource GetSchema: @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server.go:413 tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd tf_resource_type=time_sleep tf_rpc=GetProviderSchema @module=sdk.framework tf_provider_addr=registry.terraform.io/hashicorp/time timestamp=2022-10-20T08:25:18.950+1100
2022-10-20T08:25:18.952+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Calling provider defined Resource GetSchema: @module=sdk.framework tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd tf_provider_addr=registry.terraform.io/hashicorp/time tf_resource_type=time_static tf_rpc=GetProviderSchema @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server.go:411 timestamp=2022-10-20T08:25:18.950+1100
2022-10-20T08:25:18.952+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Called provider defined Resource GetSchema: @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server.go:413 @module=sdk.framework tf_provider_addr=registry.terraform.io/hashicorp/time tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd tf_resource_type=time_static tf_rpc=GetProviderSchema timestamp=2022-10-20T08:25:18.950+1100
2022-10-20T08:25:18.953+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Calling provider defined Resource GetSchema: @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server.go:411 @module=sdk.framework tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd tf_provider_addr=registry.terraform.io/hashicorp/time tf_resource_type=time_offset tf_rpc=GetProviderSchema timestamp=2022-10-20T08:25:18.950+1100
2022-10-20T08:25:18.953+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Called provider defined Resource GetSchema: tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd tf_resource_type=time_offset @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server.go:413 @module=sdk.framework tf_provider_addr=registry.terraform.io/hashicorp/time tf_rpc=GetProviderSchema timestamp=2022-10-20T08:25:18.950+1100
2022-10-20T08:25:18.953+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Calling provider defined Provider DataSources: tf_rpc=GetProviderSchema @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server.go:152 @module=sdk.framework tf_provider_addr=registry.terraform.io/hashicorp/time tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd timestamp=2022-10-20T08:25:18.950+1100
2022-10-20T08:25:18.954+1100 [DEBUG] provider.terraform-provider-time_v0.9.0_x5: Called provider defined Provider DataSources: tf_rpc=GetProviderSchema @caller=github.com/hashicorp/terraform-plugin-framework@v0.13.0/internal/fwserver/server.go:154 @module=sdk.framework tf_provider_addr=registry.terraform.io/hashicorp/time tf_req_id=38adda8a-28da-6d0c-a421-b57641a988bd timestamp=2022-10-20T08:25:18.950+1100
2022-10-20T08:25:18.954+1100 [DEBUG] No provider meta schema returned
2022-10-20T08:25:18.955+1100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2022-10-20T08:25:18.956+1100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/time/0.9.0/linux_amd64/terraform-provider-time_v0.9.0_x5 pid=3484
2022-10-20T08:25:18.956+1100 [DEBUG] provider: plugin exited
2022-10-20T08:25:18.956+1100 [INFO]  backend/local: apply calling Plan
2022-10-20T08:25:18.957+1100 [DEBUG] Building and walking plan graph for NormalMode
2022-10-20T08:25:18.957+1100 [DEBUG] ProviderTransformer: "ciscoise_node_deployment.join-ise31-2 (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/ciscoise/ciscoise"].ise31-1
2022-10-20T08:25:18.957+1100 [DEBUG] pruning unused provider["registry.terraform.io/ciscoise/ciscoise"]
2022-10-20T08:25:18.957+1100 [DEBUG] ReferenceTransformer: "ciscoise_node_deployment.join-ise31-2 (expand)" references: [var.ise-password]
2022-10-20T08:25:18.957+1100 [DEBUG] ReferenceTransformer: "var.ise-password" references: []
2022-10-20T08:25:18.957+1100 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/ciscoise/ciscoise\"].ise31-1" references: []
2022-10-20T08:25:18.957+1100 [DEBUG] Starting graph walk: walkPlan
2022-10-20T08:25:18.957+1100 [DEBUG] created provider logger: level=debug
2022-10-20T08:25:18.958+1100 [INFO]  provider: configuring client automatic mTLS
2022-10-20T08:25:18.968+1100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta args=[.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta]
2022-10-20T08:25:18.969+1100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta pid=3491
2022-10-20T08:25:18.969+1100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta
2022-10-20T08:25:18.980+1100 [INFO]  provider.terraform-provider-ciscoise_v0.6.9-beta: configuring server automatic mTLS: timestamp=2022-10-20T08:25:18.979+1100
2022-10-20T08:25:19.005+1100 [DEBUG] provider.terraform-provider-ciscoise_v0.6.9-beta: plugin address: address=/tmp/plugin1887646647 network=unix timestamp=2022-10-20T08:25:19.005+1100
2022-10-20T08:25:19.005+1100 [DEBUG] provider: using plugin: version=5
2022-10-20T08:25:19.182+1100 [DEBUG] Resource instance state not found for node "ciscoise_node_deployment.join-ise31-2", instance ciscoise_node_deployment.join-ise31-2
2022-10-20T08:25:19.182+1100 [INFO]  ReferenceTransformer: reference not found: "var.ise-password"
2022-10-20T08:25:19.183+1100 [DEBUG] ReferenceTransformer: "ciscoise_node_deployment.join-ise31-2" references: []
2022-10-20T08:25:19.183+1100 [DEBUG] refresh: ciscoise_node_deployment.join-ise31-2: no state, so not refreshing
2022-10-20T08:25:19.186+1100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2022-10-20T08:25:19.196+1100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta pid=3491
2022-10-20T08:25:19.196+1100 [DEBUG] provider: plugin exited
2022-10-20T08:25:19.196+1100 [DEBUG] building apply graph to check for errors
2022-10-20T08:25:19.197+1100 [DEBUG] Resource state not found for node "ciscoise_node_deployment.join-ise31-2", instance ciscoise_node_deployment.join-ise31-2
2022-10-20T08:25:19.197+1100 [DEBUG] ProviderTransformer: "ciscoise_node_deployment.join-ise31-2" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/ciscoise/ciscoise"].ise31-1
2022-10-20T08:25:19.197+1100 [DEBUG] ProviderTransformer: "ciscoise_node_deployment.join-ise31-2 (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/ciscoise/ciscoise"].ise31-1
2022-10-20T08:25:19.197+1100 [DEBUG] pruning unused provider["registry.terraform.io/ciscoise/ciscoise"]
2022-10-20T08:25:19.197+1100 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/ciscoise/ciscoise\"].ise31-1" references: []
2022-10-20T08:25:19.197+1100 [DEBUG] ReferenceTransformer: "ciscoise_node_deployment.join-ise31-2 (expand)" references: []
2022-10-20T08:25:19.197+1100 [DEBUG] ReferenceTransformer: "var.ise-password" references: []
2022-10-20T08:25:19.197+1100 [DEBUG] ReferenceTransformer: "ciscoise_node_deployment.join-ise31-2" references: [var.ise-password]

Terraform used the selected providers to generate the following execution plan.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # ciscoise_node_deployment.join-ise31-2 will be created
  + resource "ciscoise_node_deployment" "join-ise31-2" {
      + id           = (known after apply)
      + item         = (known after apply)
      + last_updated = (known after apply)

      + parameters {
          + allow_cert_import = "false"
          + fqdn              = "ise31-2.ise.domain.com"
          + hostname          = "ise31-2"
          + ip_address        = (known after apply)
          + node_status       = (known after apply)
          + password          = (sensitive value)
          + roles             = (known after apply)
          + services          = [
              + "Services",
              + "Profiler",
              + "DeviceAdmin",
            ]
          + user_name         = "admin"
        }
    }

Plan: 1 to add, 0 to change, 0 to destroy.
2022-10-20T08:25:19.198+1100 [INFO]  backend/local: apply calling Apply
2022-10-20T08:25:19.198+1100 [DEBUG] Building and walking apply graph for NormalMode plan
2022-10-20T08:25:19.198+1100 [DEBUG] Resource state not found for node "ciscoise_node_deployment.join-ise31-2", instance ciscoise_node_deployment.join-ise31-2
2022-10-20T08:25:19.198+1100 [DEBUG] ProviderTransformer: "ciscoise_node_deployment.join-ise31-2 (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/ciscoise/ciscoise"].ise31-1
2022-10-20T08:25:19.198+1100 [DEBUG] ProviderTransformer: "ciscoise_node_deployment.join-ise31-2" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/ciscoise/ciscoise"].ise31-1
2022-10-20T08:25:19.198+1100 [DEBUG] pruning unused provider["registry.terraform.io/ciscoise/ciscoise"]
2022-10-20T08:25:19.198+1100 [DEBUG] ReferenceTransformer: "ciscoise_node_deployment.join-ise31-2 (expand)" references: []
2022-10-20T08:25:19.198+1100 [DEBUG] ReferenceTransformer: "var.ise-password" references: []
2022-10-20T08:25:19.198+1100 [DEBUG] ReferenceTransformer: "ciscoise_node_deployment.join-ise31-2" references: [var.ise-password]
2022-10-20T08:25:19.198+1100 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/ciscoise/ciscoise\"].ise31-1" references: []
2022-10-20T08:25:19.199+1100 [DEBUG] Starting graph walk: walkApply
2022-10-20T08:25:19.199+1100 [DEBUG] created provider logger: level=debug
2022-10-20T08:25:19.200+1100 [INFO]  provider: configuring client automatic mTLS
2022-10-20T08:25:19.211+1100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta args=[.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta]
2022-10-20T08:25:19.211+1100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta pid=3499
2022-10-20T08:25:19.211+1100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta
2022-10-20T08:25:19.223+1100 [INFO]  provider.terraform-provider-ciscoise_v0.6.9-beta: configuring server automatic mTLS: timestamp=2022-10-20T08:25:19.223+1100
2022-10-20T08:25:19.246+1100 [DEBUG] provider.terraform-provider-ciscoise_v0.6.9-beta: plugin address: address=/tmp/plugin1999181339 network=unix timestamp=2022-10-20T08:25:19.246+1100
2022-10-20T08:25:19.246+1100 [DEBUG] provider: using plugin: version=5
ciscoise_node_deployment.join-ise31-2: Creating...
2022-10-20T08:25:19.426+1100 [INFO]  Starting apply for ciscoise_node_deployment.join-ise31-2
2022-10-20T08:25:19.426+1100 [DEBUG] ciscoise_node_deployment.join-ise31-2: applying the planned Create change
2022-10-20T08:25:19.427+1100 [INFO]  provider.terraform-provider-ciscoise_v0.6.9-beta: 2022/10/20 08:25:19 [DEBUG] setting computed for "parameters.0.roles" from ComputedKeys: timestamp=2022-10-20T08:25:19.427+1100
2022-10-20T08:25:19.427+1100 [INFO]  provider.terraform-provider-ciscoise_v0.6.9-beta: 2022/10/20 08:25:19 [DEBUG] setting computed for "parameters.0.roles" from ComputedKeys: timestamp=2022-10-20T08:25:19.427+1100
2022-10-20T08:25:19.428+1100 [INFO]  provider.terraform-provider-ciscoise_v0.6.9-beta: 2022/10/20 08:25:19 [DEBUG] setting computed for "item" from ComputedKeys: timestamp=2022-10-20T08:25:19.428+1100
2022-10-20T08:25:19.428+1100 [INFO]  provider.terraform-provider-ciscoise_v0.6.9-beta: 2022/10/20 08:25:19 [DEBUG] Beginning NodeDeployment create: timestamp=2022-10-20T08:25:19.428+1100
2022-10-20T08:25:19.429+1100 [INFO]  provider.terraform-provider-ciscoise_v0.6.9-beta: 2022/10/20 08:25:19 [DEBUG] request sent => {"allowCertImport":false,"fqdn":"ise31-2.ise.domain.com","password":"password123","services":["Services","Profiler","DeviceAdmin"],"userName":"admin"}: timestamp=2022-10-20T08:25:19.428+1100
2022-10-20T08:25:19.540+1100 [ERROR] vertex "ciscoise_node_deployment.join-ise31-2" error: Failure when executing RegisterNode
â•·
│ Error: Failure when executing RegisterNode
│ 
│   with ciscoise_node_deployment.join-ise31-2,
│   on main.tf line 23, in resource "ciscoise_node_deployment" "join-ise31-2":
│   23: resource "ciscoise_node_deployment" "join-ise31-2" {
│ 
│ error with operation RegisterNode
│ {
│   "message" : "request has bad input format in the body",
│   "code" : 400
│ }
╵
2022-10-20T08:25:19.563+1100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2022-10-20T08:25:19.569+1100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/ciscoise/ciscoise/0.6.9-beta/linux_amd64/terraform-provider-ciscoise_v0.6.9-beta pid=3499
2022-10-20T08:25:19.569+1100 [DEBUG] provider: plugin exited
fmunozmiranda commented 2 years ago

Ok. @aussietexan i think your problem now it´s that you are putting on services list Services as a value and API doesn´t allow it. These are allowed values for roles and Services


Roles
Enum:
[ 
  PrimaryAdmin, 
  SecondaryAdmin, 
  PrimaryMonitoring, 
  SecondaryMonitoring, 
  PrimaryDedicatedMonitoring, 
  SecondaryDedicatedMonitoring, 
  Standalone 
]

Services
Enum:
[ 
  Session, 
  Profiler, 
  TC-NAC, 
  SXP, 
  DeviceAdmin, 
  PassiveIdentity, 
  pxGrid, 
  pxGridCloud 
]
aussietexan commented 2 years ago

Arg!! I can't believe I missed that. I replaced the "Services" value with "Session" and it looks like it is working now.

I noticed that I still got an error if I had the 'roles' parameter with a null "" value, but it worked when I removed the 'roles' parameter completely.

Thanks again @fmunozmiranda!

fmunozmiranda commented 2 years ago

Happy to help!!