diff --git a/lib/ansible/modules/extras/files/blockinfile.py b/lib/ansible/modules/extras/files/blockinfile.py index 5448aafa17..10aa9f5523 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):