citrix / terraform-provider-citrixadc

Part of NetScaler Automation Toolkit | https://github.com/netscaler/automation-toolkit
https://registry.terraform.io/providers/citrix/citrixadc
Apache License 2.0
119 stars 59 forks source link

[Bug]: "Invalid argument [ipaddress]" #1159

Closed adh-cnc closed 6 months ago

adh-cnc commented 6 months ago

Terraform Core Version

1.8.3

citrixadc Provider Version

1.38.0

Operating system

MacOS

Affected Resource(s)

citrixadc_hanode

Equivalent NetScaler CLI Command

Unknown

Expected Behavior

HA configuration should succeed.

Actual Behavior

TF plan works and displays expected information, local node configures and then error message is displayed about the argument "ipaddress" being invalid. Documentation reflects this is the correct argument to use.

Relevant Error/Panic Output Snippet

Error: [ERROR] nitro-go: Failed to update resource of type hanode,  err=failed: 599 Netscaler specific error ({ "errorcode": 278, "message": "Invalid argument [ipaddress]", "severity": "ERROR" })
│ 
│   with module.configure-vpx-ha.citrixadc_hanode.vpx_primary,
│   on .terraform/modules/configure-vpx-ha/terraform/configure_ha.tf line 8, in resource "citrixadc_hanode" "vpx_primary":
│    8: resource "citrixadc_hanode" "vpx_primary" {
│ 
╵

Terraform Configuration Files

resource "citrixadc_hanode" "local_node" {
  provider      = citrixadc.PRIMARY
  hanode_id     = 0
  hellointerval = 400
  deadinterval  = 30
}

resource "citrixadc_hanode" "vpx_primary" {
  hanode_id = citrixadc_hanode.local_node.hanode_id
  ipaddress = var.primary_vpx_nsip
  provider = citrixadc.PRIMARY
  depends_on = [ citrixadc_hanode.local_node ]
}

resource "citrixadc_hanode" "vpx_secondary" {
  hanode_id = 1
  ipaddress = var.secondary_vpx_nsip
  provider = citrixadc.SECONDARY
  depends_on = [ citrixadc_hanode.vpx_primary ]
}

resource "citrixadc_nsrpcnode" "vpx_primary_a" {
  ipaddress = var.primary_vpx_nsip
  password = var.vpx_rpc_node_password
  secure = "ON"
  provider = citrixadc.PRIMARY
  depends_on = [ citrixadc_hanode.primary_vpx ]
}

resource "citrixadc_nsrpcnode" "vpx_primary_b" {
  ipaddress = var.secondary_vpx_nsip
  password = var.vpx_rpc_node_password
  secure = "ON"
  provider = citrixadc.SECONDARY
  depends_on = [ citrixadc_hanode.primary_vpx ]
}

resource "citrixadc_nsrpcnode" "vpx_secondary_a" {
  ipaddress = var.secondary_vpx_nsip
  password = var.vpx_rpc_node_password
  secure = "ON"
  provider = citrixadc.SECONDARY
  depends_on = [ citrixadc_hanode.vpx_secondary ]
}

resource "citrixadc_nsrpcnode" "vpx_secondary_b" {
  ipaddress = var.primary_vpx_nsip
  password = var.vpx_rpc_node_password
  secure = "ON"
  provider = citrixadc.PRIMARY
  depends_on = [ citrixadc_hanode.vpx_secondary ]
}

Steps to Reproduce

terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

rohit-myali commented 6 months ago

Hello @adh-cnc Thanks for raising this request.

I see from the above configuration that:

resource "citrixadc_hanode" "vpx_primary" {
  hanode_id  = citrixadc_hanode.local_node.hanode_id
  ipaddress  = var.primary_vpx_nsip
  provider   = citrixadc.PRIMARY
  depends_on = [citrixadc_hanode.local_node]
}

resource "citrixadc_hanode" "vpx_secondary" {
  hanode_id  = 1
  ipaddress  = var.secondary_vpx_nsip
  provider   = citrixadc.SECONDARY
  depends_on = [citrixadc_hanode.vpx_primary]
}

We have written a terraform-script/module to configure HA you can refer that from HERE


Instead, the above two block should be modified as follows:

resource "citrixadc_hanode" "vpx_primary" {
  hanode_id  = 1
  ipaddress  = var.secondary_vpx_nsip
  provider   = citrixadc.PRIMARY
  depends_on = [citrixadc_hanode.local_node]
}

resource "citrixadc_hanode" "vpx_secondary" {
  hanode_id  = 1
  ipaddress  = var.primary_vpx_nsip
  provider   = citrixadc.SECONDARY
  depends_on = [citrixadc_hanode.vpx_primary]
}

Please check the above link provided to configure HA. (I am providing it again HERE) Please update me here on any progress.

Thanks Rohit