Fixes #6077 decode escaped newline characters in content for the copy module
This commit is contained in:
parent
76037168b1
commit
9ba1245a84
1 changed files with 6 additions and 0 deletions
|
@ -54,6 +54,12 @@ class ActionModule(object):
|
|||
raw = utils.boolean(options.get('raw', 'no'))
|
||||
force = utils.boolean(options.get('force', 'yes'))
|
||||
|
||||
# content with newlines is going to be escaped to safely load in yaml
|
||||
# now we need to unescape it so that the newlines are evaluated properly
|
||||
# when writing the file to disk
|
||||
if content:
|
||||
content = content.decode('unicode-escape')
|
||||
|
||||
if (source is None and content is None and not 'first_available_file' in inject) or dest is None:
|
||||
result=dict(failed=True, msg="src (or content) and dest are required")
|
||||
return ReturnData(conn=conn, result=result)
|
||||
|
|
Loading…
Reference in a new issue