I’m trying to pass a value via Salt’s lxd_container.present
function, I have a block that looks kind of like this:
devices:
srv-aux:
path: /aux
pool: default
source: srv-aux
readonly: True
type: disk
This is then converted to JSON and passed in as a single blob under the devices
directive as a device in in lxd_container.present
, like so:
{{ device }}: {{ devices[device]|tojson }}
I think the error I’m getting back is from LXD however:
Result: False
Comment: json: cannot unmarshal bool into Go struct field InstancePut.devices of type string
I understand what the error means (“True” is not the same thing as bool True), but I’m wondering if you have any idea how I could actually pass this as a bool, or if this could be a bug.
Since there’s no strict typing in JSON or YAML that I’m aware of, I don’t really see any way for me to specify before-hand that this isn’t a string before it hits the Go binary.