From 8ccf166a56a6ce30ff1b19f0cd54d94e6dfbf5cf Mon Sep 17 00:00:00 2001 From: Koki Nomura Date: Fri, 18 Nov 2016 03:28:09 +0900 Subject: [PATCH] blockinfile: Fixes #1926 by comparing a marker to a whole line instead of a line prefix (#3339) --- lib/ansible/modules/extras/files/blockinfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/files/blockinfile.py b/lib/ansible/modules/extras/files/blockinfile.py index 5448aafa177..10aa9f55235 100755 --- a/lib/ansible/modules/extras/files/blockinfile.py +++ b/lib/ansible/modules/extras/files/blockinfile.py @@ -258,9 +258,9 @@ def main(): n0 = n1 = None for i, line in enumerate(lines): - if line.startswith(marker0): + if line == marker0: n0 = i - if line.startswith(marker1): + if line == marker1: n1 = i if None in (n0, n1):