diff --git a/lib/ansible/modules/cloud/misc/terraform.py b/lib/ansible/modules/cloud/misc/terraform.py index 5c09349b27d..7f5fa6dcb11 100644 --- a/lib/ansible/modules/cloud/misc/terraform.py +++ b/lib/ansible/modules/cloud/misc/terraform.py @@ -145,6 +145,7 @@ import os import json import tempfile import traceback +from ansible.module_utils.six.moves import shlex_quote from ansible.module_utils.basic import AnsibleModule @@ -296,7 +297,7 @@ def main(): for k, v in variables.items(): variables_args.extend([ '-var', - '{0}={1}'.format(k, v) + shlex_quote('{0}={1}'.format(k, v)) ]) if variables_file: variables_args.extend(['-var-file', variables_file])