-
Notifications
You must be signed in to change notification settings - Fork 33
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
Host parameters of type JSON lead to errors on import #136
Comments
Hi @rsommer, could you provide an example of your Terraform code? Issue #129 is related to host groups, and your issue seems to be related to importing existing hosts as What provider version are you using? Are earlier versions working with the same code? (you can downgrade to all published versions in the TF registry). |
Hi @bitkeks, I am using
and using
Simply removing the parameter resolves the problem which is fine in the test case, but not when the parameter is actually used. I tried the provider versions 0.5.1, 0.5.8, 0.6.0 and 0.6.2 - all with the same result. |
The issue is in the host JSON unmarshal function. It does not handle the JSON/map structure behind the "parameters": [
{
"name": "json_testparam",
"parameter_type": "json",
"associated_type": "host",
"hidden_value?": false,
"value": {
"testkey": 123
}
},
{
"name": "testhoststring",
"parameter_type": "string",
"associated_type": "host",
"hidden_value?": false,
"value": "yes"
}
] The first entry is the JSON type, and type ForemanKVParameter struct {
Name string `json:"name"`
Value string `json:"value"`
} We'd need to have to refactor/create the |
Having an existing host in foreman with a host parameter of type JSON, a
terraform import
of said host results inThis may relate to #129
The text was updated successfully, but these errors were encountered: