From 3216c31401d15906e2435422e71dfb96e30678c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lecour?= Date: Sat, 1 Dec 2018 22:09:45 +0100 Subject: [PATCH] Set the correct return message. In these cases, the lines are added, not replaced. --- lib/ansible/modules/files/lineinfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/files/lineinfile.py b/lib/ansible/modules/files/lineinfile.py index 47b0b5a0d81..6e9047d95d0 100644 --- a/lib/ansible/modules/files/lineinfile.py +++ b/lib/ansible/modules/files/lineinfile.py @@ -338,12 +338,12 @@ def present(module, dest, regexp, line, insertafter, insertbefore, create, if index[1] <= 0: if b_lines[index[1]].rstrip(b('\r\n')) != b_line: b_lines.insert(index[1], b_line + b_linesep) - msg = 'line replaced' + msg = 'line added' changed = True elif b_lines[index[1] - 1].rstrip(b('\r\n')) != b_line: b_lines.insert(index[1], b_line + b_linesep) - msg = 'line replaced' + msg = 'line added' changed = True elif b_lines[index[0]] != b_new_line: