mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #1550 from bcoca/1549_lininfile_backup_bug
fixes #1549
This commit is contained in:
commit
43410c46f9
1 changed files with 1 additions and 1 deletions
|
@ -143,7 +143,7 @@ def present(module, dest, regexp, line, insertafter, create, backup):
|
|||
changed = True
|
||||
|
||||
if changed:
|
||||
if backup:
|
||||
if backup and os.path.exists(dest):
|
||||
module.backup_local(dest)
|
||||
f = open(dest, 'wb')
|
||||
f.writelines(lines)
|
||||
|
|
Loading…
Reference in a new issue