Commit b0932e16 by Daniel Hokka Zakrisson

Merge pull request #1999 from dorfsmay/pullreq-lineinfile

Clarification on how to use insertafter with a regex.
parents 43c9a665 05a3876d
...@@ -64,7 +64,7 @@ options: ...@@ -64,7 +64,7 @@ options:
after the specified regular expression. Two special values are after the specified regular expression. Two special values are
available; C(BOF) for inserting the line at the beginning of the available; C(BOF) for inserting the line at the beginning of the
file, and C(EOF) for inserting the line at the end of the file. file, and C(EOF) for inserting the line at the end of the file.
choices: [ BOF, EOF ] choices: [ BOF, EOF, *regex* ]
default: EOF default: EOF
create: create:
required: false required: false
...@@ -83,6 +83,7 @@ options: ...@@ -83,6 +83,7 @@ options:
examples: examples:
- code: "lineinfile: dest=/etc/selinux/config regexp=^SELINUX= line=SELINUX=disabled" - code: "lineinfile: dest=/etc/selinux/config regexp=^SELINUX= line=SELINUX=disabled"
- code: 'lineinfile: dest=/etc/sudoers state=absent regexp="^%wheel"' - code: 'lineinfile: dest=/etc/sudoers state=absent regexp="^%wheel"'
- code: 'lineinfile: dest=/etc/httpd/conf/httpd.conf regexp="^Listen " insertafter="^#Listen " line="Listen 8080"'
''' '''
def present(module, dest, regexp, line, insertafter, create, backup): def present(module, dest, regexp, line, insertafter, create, backup):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment