diff --git a/library/files/replace b/library/files/replace index f4193ae9f3..536ac8cd8f 100644 --- a/library/files/replace +++ b/library/files/replace @@ -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: