terraform-coop / terraform-provider-foreman

Terraform provider for Foreman
https://registry.terraform.io/providers/terraform-coop/foreman
Mozilla Public License 2.0
33 stars 31 forks source link

subnets without vlanid #20

Closed yuqo2450 closed 3 years ago

yuqo2450 commented 3 years ago

Terraform wants to change a subnet everytime I run apply when the "vlanid" attribute is omitted. I also set it to null with same result.

mgusek-interhyp commented 3 years ago

The error is known, I am working on it

mgusek-interhyp commented 3 years ago

For clarification: Can you run in Debug-Mode and post the output ?

yuqo2450 commented 3 years ago

Not sure if the debug log helps, cause there appears no errors at all. It just seems vlanid can't be null and if you set it to null foreman somehow reapplies sth. When calling apply or plan the output of terraform is: vlanid = "%!f(\<nil>)" -> null Probably this helps. Hope linking the log file works as expected? terraform-provider-foreman.log

mgusek-interhyp commented 3 years ago

With https://github.com/HanseMerkur/terraform-provider-foreman/pull/21 i address this problem. After merging and creating a new version you may fix your terraform.tfstate from "vlanid": "%!f()" to "vlanid": 0 or remove this entire line. With next run of terraform, you should have an clean file