From b0599ae2d9dd0d51017acb329a0da2ab516569ff Mon Sep 17 00:00:00 2001 From: Yves Dorfsman Date: Wed, 6 Feb 2013 01:25:30 -0700 Subject: [PATCH] Clarification on how to use insertafter with a regex. --- lineinfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lineinfile b/lineinfile index d0f4244b98c..99732a28dbf 100644 --- a/lineinfile +++ b/lineinfile @@ -64,7 +64,7 @@ options: after the specified regular expression. Two special values are 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. - choices: [ BOF, EOF ] + choices: [ BOF, EOF, *regex* ] default: EOF create: required: false @@ -83,6 +83,7 @@ options: examples: - code: "lineinfile: dest=/etc/selinux/config regexp=^SELINUX= line=SELINUX=disabled" - 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):