From 667f62c5a8d4f958b9027376be8bb913333a2190 Mon Sep 17 00:00:00 2001 From: Dan Farrell Date: Sat, 1 Sep 2018 22:18:33 -0500 Subject: [PATCH] Update lineinfile.py (#44976) * Update lineinfile.py The document should call out in the regexp section what regexp does in non-match scenario, not just leave it for the reader to find it under `insertbefore` and `insertafter`. +label: docsite_pr * Update lineinfile.py fixing for lint * Use multiple entries --- lib/ansible/modules/files/lineinfile.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/ansible/modules/files/lineinfile.py b/lib/ansible/modules/files/lineinfile.py index a898f7cb3d..f9f044d9d2 100644 --- a/lib/ansible/modules/files/lineinfile.py +++ b/lib/ansible/modules/files/lineinfile.py @@ -40,13 +40,15 @@ options: aliases: [ dest, destfile, name ] required: true regexp: - aliases: [ 'regex' ] + aliases: [ regex ] description: - - The regular expression to look for in every line of the file. For - C(state=present), the pattern to replace if found. Only the last line - found will be replaced. For C(state=absent), the pattern of the line(s) - to remove. Uses Python regular expressions. - See U(http://docs.python.org/2/library/re.html). + - The regular expression to look for in every line of the file. + - For C(state=present), the pattern to replace if found. Only the last line found will be replaced. + - For C(state=absent), the pattern of the line(s) to remove. + - If the regular expression is not matched, the line will be + added to the file in keeping with`insertbefore` or `insertafter` + settings. + - Uses Python regular expressions. See U(http://docs.python.org/2/library/re.html). version_added: '1.7' state: description: