Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Renaming a citrixadc_systemcmdpolicy used by a citrixadc_systemgroup leads to an "inconsistent final plan" error #1182

Open
joachimBurket opened this issue Jul 17, 2024 · 1 comment
Labels

Comments

@joachimBurket
Copy link

Terraform Core Version

1.7.2

citrixadc Provider Version

1.39.0

Operating system

RHEL9

Affected Resource(s)

  • citrixadc_systemcmdpolicy
  • citrixadc_systemgroup

Equivalent NetScaler CLI Command

set system cmdPolicy policyName "other-name"

Expected Behavior

The cmdPolicy name is updated, and the system-group link is updated.

Actual Behavior

Terraform returns the following error:

│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for citrixadc_systemgroup.adm_itop to include new values learned so far during apply, provider
│ "registry.opentofu.org/citrix/citrixadc" produced an invalid new value for .cmdpolicybinding: planned set element
│ cty.ObjectVal(map[string]cty.Value{"policyname":cty.StringVal("itop-operator"), "priority":cty.NumberIntVal(100)}) does not correlate with any element in
│ actual.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "citrixadc_systemcmdpolicy" "itop_operator" {
  policyname = "itop_operator"
  action     = "ALLOW"
  cmdspec    = "(^man.*)|(^show\\s+(?!configstatus)(?!ns ns\\.conf)(?!ns savedconfig)(?!ns runningConfig)(?!gslb runningConfig)(?!audit messages)(?!techsupport).*)|(^stat.*)|(^(enable|disable) (server|service).*)|(^save ns config)"
}
resource "citrixadc_systemgroup" "adm_itop" {
  groupname = "adm_itop"
  timeout   = "7200"
  cmdpolicybinding {
    policyname = citrixadc_systemcmdpolicy.itop_operator.policyname
    priority   = 100
  }
}

Steps to Reproduce

Update the citrixadc_systemcmdpolicy's policyname, and apply the configuration

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

@joachimBurket
Copy link
Author

After another test, it seems that it is the renaming of the citrixadc_systemcmdpolicy's policyName that is not working.
When the policyName is updated, the actual policy name in the NetScaler isn't changed (even if terraform indicates that the policyName is changed.

If I delete the resources and re-create them with another policyName, it works.

Is it not supported to change a citrixadc_systemcmdpolicy's policyName after its creation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant