lineinfile \- Ensure a particular line is in a file
lineinfile \- Ensure a particular line is in a file
@ -8,35 +8,27 @@ lineinfile \- Ensure a particular line is in a file
This module will search a file for a line, and ensure that it is present or absent.
This module will search a file for a line, and ensure that it is present or absent.
.PP
.PP
This is primarily useful when you want to change a single line in a file only. For other cases, see the \fIcopy\fR or \fItemplate\fR modules.
This is primarily useful when you want to change a single line in a file only. For other cases, see the \fIcopy\fR or \fItemplate\fR modules.
."------OPTIONS
."------OPTIONS
."
."
."
."
.SHOPTIONS
.SHOPTIONS
.IPname
The file to modify
(required)
.IPregexp
The regular expression to look for in the file. For \fIstate=present\fR, the pattern to replace. For \fIstate=absent\fR, the pattern of the line to remove.
(required)
.IPstate
.IPstate
Whether the line should be there or not.
Whether the line should be there or not.
.".SSChoices
.IRChoices:
.IRChoices:
present,absent.
present,absent. (default: present)
.IPline
.IPname
Required for \fIstate=present\fR. The line to insert/replace into the file. Must match the value given to \fCregexp\fR.
The file to modify(required)
.IPinsertafter
.IPinsertafter
Used with \fIstate=present\fR. If specified, the line will be inserted after the specified regular expression. Two special values are available; \fCBOF\fR for inserting the line at the beginning of the file, and \fCEOF\fR for inserting the line at the end of the file.
Used with \fIstate=present\fR. If specified, the line will be inserted after the specified regular expression. Two special values are available; \fCBOF\fR for inserting the line at the beginning of the file, and \fCEOF\fR for inserting the line at the end of the file.
.".SSChoices
.IRChoices:
.IRChoices:
BOF,EOF.
BOF,EOF. (default: EOF)
.IPregexp
The regular expression to look for in the file. For \fIstate=present\fR, the pattern to replace. For \fIstate=absent\fR, the pattern of the line to remove.(required)
.IPline
Required for \fIstate=present\fR. The line to insert/replace into the file. Must match the value given to \fCregexp\fR.
.IPbackup
.IPbackup
Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.."