From ffcebd317ba53c90d6f8a857ce8776b32f371c80 Mon Sep 17 00:00:00 2001 From: Jay Jahns Date: Mon, 8 Oct 2018 05:14:58 -0500 Subject: [PATCH] Account for boolean OVF properties (#45529) Currently, Ansible interprets variables with a True|False value as boolean. This causes the vmware_deploy_ovf module to break, because it can only accept string values as properties. This fix checks if a value is boolean, and converts it to a string if it is. Since integers do not seem to be causing the same error, this is the only check we appear to need. After completion, OVF properties that are boolean can be specified as yes|no or true|false. Closes: #45528 --- lib/ansible/modules/cloud/vmware/vmware_deploy_ovf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/vmware/vmware_deploy_ovf.py b/lib/ansible/modules/cloud/vmware/vmware_deploy_ovf.py index 9236113b67c..6b673a711f7 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_deploy_ovf.py +++ b/lib/ansible/modules/cloud/vmware/vmware_deploy_ovf.py @@ -343,7 +343,7 @@ class VMwareDeployOvf: for key, value in self.params['properties'].items(): property_mapping = vim.KeyValue() property_mapping.key = key - property_mapping.value = value + property_mapping.value = str(value) if isinstance(value, bool) else value params['propertyMapping'].append(property_mapping) if self.params['folder']: