modules/terraform: Quote the variable values in the command line (#43493)

* modules/terraform: Quote the variable values in the command line

Fixes: #43492

* fix six import
pull/44733/head
Rémi REY 6 years ago committed by Ryan Brown
parent 397febd343
commit 26be68dd1c

@ -145,6 +145,7 @@ import os
import json import json
import tempfile import tempfile
import traceback import traceback
from ansible.module_utils.six.moves import shlex_quote
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
@ -296,7 +297,7 @@ def main():
for k, v in variables.items(): for k, v in variables.items():
variables_args.extend([ variables_args.extend([
'-var', '-var',
'{0}={1}'.format(k, v) shlex_quote('{0}={1}'.format(k, v))
]) ])
if variables_file: if variables_file:
variables_args.extend(['-var-file', variables_file]) variables_args.extend(['-var-file', variables_file])

Loading…
Cancel
Save