You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when adding a host group with parameters, i'm getting errors like this:
Error: json: cannot unmarshal bool into Go struct field ForemanKVParameter.parameters.value of type string
│
│ with foreman_hostgroup.Compute,
│ on hostgroups.tf line 1, in resource "foreman_hostgroup" "Compute":
│ 1: resource "foreman_hostgroup" "Compute" {
i've tried quoting the booleans, quoting the keys. neither seems to work, and i'm not sure if the provider's complaining about the booleans in that parameters map or something else entirely. this is happening with the 0.6.0 or the last 0.5.8 provider releases, at least.
what's the proper format for adding host group parameters? am i missing something?
The text was updated successfully, but these errors were encountered:
in the hostgroup resource definition, is this right?
"parameters": {
Type: schema.TypeMap,
ForceNew: false,
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Description: "A map of parameters that will be saved as hostgroup parameters " +
"in the group config.",
},
the map elements can contain booleans, but it's unclear to me whether the foreman api expects bools to be passed as strings or if this element type needs to accommodate other data types, like bools.
we tested your example code and neither tf apply nor tf import show the error in our setup. Could you please dig further if the error might be caused somewhere else?
You can enable a debug log by configuring the provider as follows:
It's the same issue as in #136, see my post #136 (comment). The host decode struct expects the value to be of type string only, so the refactoring for JSON parameters will have the same effect as a refactoring to handle booleans for this issue.
The conversion from "true" to true happens somewhere in between, but is acceptable. We should focus on the resolution to handle more than string types.
when adding a host group with parameters, i'm getting errors like this:
the resources look roughly like this:
i've tried quoting the booleans, quoting the keys. neither seems to work, and i'm not sure if the provider's complaining about the booleans in that parameters map or something else entirely. this is happening with the 0.6.0 or the last 0.5.8 provider releases, at least.
what's the proper format for adding host group parameters? am i missing something?
The text was updated successfully, but these errors were encountered: