lineinfile - Use ANSIBLE_REMOTE_TMP for temporary file (#69543)

pull/69553/head
Sam Doran 5 years ago committed by GitHub
parent 34db57a47f
commit b8469d5c7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- lineinfile - use ``module.tmpdir`` to allow configuration of the remote temp directory (https://github.com/ansible/ansible/issues/68218)

@ -213,7 +213,7 @@ from ansible.module_utils._text import to_bytes, to_native
def write_changes(module, b_lines, dest):
tmpfd, tmpfile = tempfile.mkstemp()
tmpfd, tmpfile = tempfile.mkstemp(dir=module.tmpdir)
with os.fdopen(tmpfd, 'wb') as f:
f.writelines(b_lines)

Loading…
Cancel
Save