mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
module replace - report changed only if contents is changed
This commit is contained in:
@@ -139,7 +139,7 @@ def main():
|
||||
mre = re.compile(params['regexp'], re.MULTILINE)
|
||||
result = re.subn(mre, params['replace'], contents, 0)
|
||||
|
||||
if result[1] > 0:
|
||||
if result[1] > 0 and contents != result[0]:
|
||||
msg = '%s replacements made' % result[1]
|
||||
changed = True
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user