Skip to content

Commit

Permalink
Allow complex values in variables parameter of terraform module (#4281)
Browse files Browse the repository at this point in the history
* Allow complex values in variables parameter

Signed-off-by: Webster Mudge <[email protected]>

* Add changelog fragment

Signed-off-by: Webster Mudge <[email protected]>

* Update changelogs fragments formatting

Co-authored-by: Felix Fontein <[email protected]>

Co-authored-by: Felix Fontein <[email protected]>
  • Loading branch information
wmudge and felixfontein authored Mar 10, 2022
1 parent 43af053 commit 4cc7f41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/4281-terraform-complex-variables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- terraform - fix ``variable`` handling to allow complex values (https://github.com/ansible-collections/community.general/pull/4281).
2 changes: 1 addition & 1 deletion plugins/modules/cloud/misc/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def main():
for k, v in variables.items():
variables_args.extend([
'-var',
'{0}={1}'.format(k, v)
'{0}={1}'.format(k, json.dumps(v))
])
if variables_files:
for f in variables_files:
Expand Down

0 comments on commit 4cc7f41

Please sign in to comment.