From 13b3cfc040ce87cbd0c6f9f6e6f4198706789767 Mon Sep 17 00:00:00 2001 From: Keiichi Hirobe Date: Thu, 28 Mar 2019 03:13:28 +0900 Subject: [PATCH] Add clarification to insertbefore and insertafter paramaters in lineinfile (#54409) --- lib/ansible/modules/files/lineinfile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/files/lineinfile.py b/lib/ansible/modules/files/lineinfile.py index a8e618ddfa..1283d33e5d 100644 --- a/lib/ansible/modules/files/lineinfile.py +++ b/lib/ansible/modules/files/lineinfile.py @@ -82,8 +82,9 @@ options: - If the first match is required, use(firstmatch=yes). - A special value is available; C(EOF) for inserting the line at the end of the file. - If specified regular expression has no matches, EOF will be used instead. + - If C(insertbefore) is set, default value C(EOF) will be ignored. - If regular expressions are passed to both C(regexp) and C(insertafter), C(insertafter) is only honored if no match for C(regexp) is found. - - May not be used with C(backrefs). + - May not be used with C(backrefs) or C(insertbefore). type: str choices: [ EOF, '*regex*' ] default: EOF @@ -95,7 +96,7 @@ options: - A value is available; C(BOF) for inserting the line at the beginning of the file. - If specified regular expression has no matches, the line will be inserted at the end of the file. - If regular expressions are passed to both C(regexp) and C(insertbefore), C(insertbefore) is only honored if no match for C(regexp) is found. - - May not be used with C(backrefs). + - May not be used with C(backrefs) or C(insertafter). type: str choices: [ BOF, '*regex*' ] version_added: "1.1"