diff options
author | David Shrewsbury <Shrews@users.noreply.github.com> | 2020-06-16 20:48:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-16 20:48:08 +0200 |
commit | fc448ea54f1595e8d24e72abd9b5245ec6165842 (patch) | |
tree | e5d4528b29190bf40063c96d97f8265e34298c4d | |
parent | document return values of file module (#69560) (diff) | |
download | ansible-fc448ea54f1595e8d24e72abd9b5245ec6165842.tar.xz ansible-fc448ea54f1595e8d24e72abd9b5245ec6165842.zip |
Clarify blockinfile docs for insertafter/insertbefore (#69396)
* Clarify blockinfile docs for insertafter/insertbefore
It's not clear from the docs that these options take effect
only when no marker lines are found in the document.
* Add changelog fragment
-rw-r--r-- | changelogs/fragments/69396-blockinfile-docs.yaml | 2 | ||||
-rw-r--r-- | lib/ansible/modules/blockinfile.py | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/changelogs/fragments/69396-blockinfile-docs.yaml b/changelogs/fragments/69396-blockinfile-docs.yaml new file mode 100644 index 0000000000..386ca5a5ff --- /dev/null +++ b/changelogs/fragments/69396-blockinfile-docs.yaml @@ -0,0 +1,2 @@ +minor_changes: +- blockinfile - Update module documentation to clarify insertbefore/insertafter usage. diff --git a/lib/ansible/modules/blockinfile.py b/lib/ansible/modules/blockinfile.py index ecb06d45c3..38eecf574c 100644 --- a/lib/ansible/modules/blockinfile.py +++ b/lib/ansible/modules/blockinfile.py @@ -35,7 +35,7 @@ options: marker: description: - The marker line template. - - C({mark}) will be replaced with the values C(in marker_begin) (default="BEGIN") and C(marker_end) (default="END"). + - C({mark}) will be replaced with the values in C(marker_begin) (default="BEGIN") and C(marker_end) (default="END"). - Using a custom marker without the C({mark}) variable may result in the block being repeatedly inserted on subsequent playbook runs. type: str default: '# {mark} ANSIBLE MANAGED BLOCK' @@ -48,7 +48,7 @@ options: aliases: [ content ] insertafter: description: - - If specified, the block will be inserted after the last match of specified regular expression. + - If specified and no begin/ending C(marker) lines are found, the block will be inserted after the last match of specified regular expression. - A special value is available; C(EOF) for inserting the block at the end of the file. - If specified regular expression has no matches, C(EOF) will be used instead. type: str @@ -56,7 +56,7 @@ options: default: EOF insertbefore: description: - - If specified, the block will be inserted before the last match of specified regular expression. + - If specified and no begin/ending C(marker) lines are found, the block will be inserted before the last match of specified regular expression. - A special value is available; C(BOF) for inserting the block at the beginning of the file. - If specified regular expression has no matches, the block will be inserted at the end of the file. type: str |