-
Notifications
You must be signed in to change notification settings - Fork 453
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
vApp properties of type 'boolean' behave counter-intuitive #1414
Comments
In Terraform a Example: Variable for the Terraform provider for VMware vSphere configuration. variable "vsphere_insecure" {
type = bool
description = "Allow insecure connections. Set to `true` for self-signed certificates."
default = false
} However, for OVF properties, even though the type is Example: Variable for Terraform provider for VMware vSphere to pass as an OVF property to an OVA. variable "appliance_ssh_enabled" {
type = string
description = "Enable SSH on the virtual appliance. One of `True` or `False`."
default = "True"
}
Hope this helps, Recommend: |
I agree this does not necessarily needs to be treated as a bug, but I think a clear warning would need to be added in the documentation then. |
@djpbessems - Can you update the label to documentation? If so, I'll update this in an documentation update that I'm currently addressing. Ryan Recommend: |
I'm afraid I cannot; I am not a contributor. |
No worries, I'll work on addressing it with the PM. Ryan |
Does the above help to answer your questions on passing the bool vApp properties? I've addressed the documentation gap in #1513 which is pending review and merge. Ryan |
Well I already knew how to use the boolean properties; I created the ticket because the current behaviour is counter intuitive, even if documentation is in place. And in all honesty, while your proposed PR does mention the way to deal with booleans, it is not easily found when looking up documentation on vApp properties and will be overlooked almost certainly by end-users. So to answer your question, no it does not help answering my questions, but that wasn't the point of me creating the ticket; instead I would suggest adapting the behaviour so that the provider accepts all variants I listed and translates appropiately. But that's all I can do, suggest change; if the maintainers of this repo decide otherwise, so be it. Maybe worth adding; I don't see this as a fault of Terraform or this TF provider, but lacking implementation of the OVF specification on VMware's part. |
Thanks for the response @djpbessems. Please note that to date, the reference pull request for the docs update is not yet merged by the maintainers. Ryan |
cc @iBrandyJackson and @appilon for review and next steps. |
While I agree it will be common for new users to trip up here, this is a problem common to all providers that allow for passing map data directly to the vendor, they have to maintain a mental model in their mind of Terraform/Golang's type system and recognize when they aren't working with it anymore (in this case they are defining a Unfortunately Terraform maps must remain homogenous (can't have mixed types) So this map in question likely needs to remain a Oddly enough @tenthirtyam I did try the crafty workaround in terraform console and it did work? at least it did locally for me in terraform v1.1.3
With all that said, this issue will be closed once the documentation updates are merged. |
Updates `virtual_machine.html.markdown`: - Updated for content accuracy. - Updated all examples to be more readable and complete. - Included continuity between examples. - Addressed concerns mentioned in #1425, #1414, and #1356. - Added some clarify based on issues #1435 and #1406 re: `scsi_type` Signed-off-by: Ryan Johnson <[email protected]>
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
0.15.0
vSphere Provider Version
v1.26.0
Affected Resource(s)
vsphere_virtual_machine
Terraform Configuration Files
Debug Output
n/a
Panic Output
n/a
Expected Behavior
All formats in the supplied code result in a vApp property being set to the corresponding boolean value.
Actual Behavior
The following error is returned:
I guess not many people have had a need yet to use vApp properties of a type other than string or int, but boolean type right now only works correctly when you use a capitalized string
True
/False
for its value.Steps to Reproduce
terraform apply
Important Factoids
Tested on a vCenter v6.7
References
n/a
Community Note
The text was updated successfully, but these errors were encountered: