Skip to content

Commit

Permalink
[PR #7535/af5da7d4 backport][stable-8] fix(modules/terraform): handle…
Browse files Browse the repository at this point in the history
… multiline strings correctly in complex variables (#7599)

fix(modules/terraform): handle multiline strings correctly in complex variables (#7535)

(cherry picked from commit af5da7d)

Co-authored-by: Yann Soubeyrand <[email protected]>
  • Loading branch information
patchback[bot] and yann-soubeyrand authored Nov 24, 2023
1 parent c1d142f commit ff8e678
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "terraform - fix multiline string handling in complex variables (https://github.com/ansible-collections/community.general/pull/7535)."
2 changes: 1 addition & 1 deletion plugins/modules/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def main():

def format_args(vars):
if isinstance(vars, str):
return '"{string}"'.format(string=vars.replace('\\', '\\\\').replace('"', '\\"'))
return '"{string}"'.format(string=vars.replace('\\', '\\\\').replace('"', '\\"')).replace('\n', '\\n')
elif isinstance(vars, bool):
if vars:
return 'true'
Expand Down

0 comments on commit ff8e678

Please sign in to comment.