lineinfile - Use ANSIBLE_REMOTE_TMP for temporary file (#69543)
This commit is contained in:
parent
34db57a47f
commit
b8469d5c7a
2 changed files with 3 additions and 1 deletions
2
changelogs/fragments/lineinfile-use-module-tempdir.yaml
Normal file
2
changelogs/fragments/lineinfile-use-module-tempdir.yaml
Normal file
|
@ -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):
|
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:
|
with os.fdopen(tmpfd, 'wb') as f:
|
||||||
f.writelines(b_lines)
|
f.writelines(b_lines)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue