mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.7 KiB
Groff
51 lines
1.7 KiB
Groff
12 years ago
|
.TH ANSIBLE.LINEINFILE 5 "2012-10-02" "0.8" "ANSIBLE MODULES"
|
||
12 years ago
|
." generated from library/lineinfile
|
||
|
.SH NAME
|
||
|
lineinfile \- Ensure a particular line is in a file
|
||
|
." ------ DESCRIPTION
|
||
|
.SH DESCRIPTION
|
||
|
.PP
|
||
|
This module will search a file for a line, and ensure that it is present or absent.
|
||
|
.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.
|
||
|
." ------ OPTIONS
|
||
|
."
|
||
|
."
|
||
|
.SH OPTIONS
|
||
12 years ago
|
|
||
12 years ago
|
.IP state
|
||
12 years ago
|
Whether the line should be there or not.
|
||
12 years ago
|
.IR Choices :
|
||
12 years ago
|
present,absent. (default: present)
|
||
|
.IP name
|
||
|
The file to modify(required)
|
||
12 years ago
|
.IP insertafter
|
||
12 years ago
|
Used with \fCstate=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.
|
||
12 years ago
|
.IR Choices :
|
||
12 years ago
|
BOF,EOF. (default: EOF)
|
||
|
.IP regexp
|
||
12 years ago
|
The regular expression to look for in the file. For \fCstate=present\fR, the pattern to replace. For \fCstate=absent\fR, the pattern of the line to remove.(required)
|
||
12 years ago
|
.IP line
|
||
12 years ago
|
Required for \fCstate=present\fR. The line to insert/replace into the file. Must match the value given to \fCregexp\fR.
|
||
12 years ago
|
.IP backup
|
||
12 years ago
|
Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.."
|
||
12 years ago
|
."
|
||
|
." ------ NOTES
|
||
|
."
|
||
|
."
|
||
|
." ------ EXAMPLES
|
||
|
.SH EXAMPLES
|
||
|
.PP
|
||
|
.nf
|
||
|
lineinfile name=/etc/selinux/config regexp=^SELINUX= line=SELINUX=disabled
|
||
|
.fi
|
||
|
.PP
|
||
|
.nf
|
||
|
lineinfile name=/etc/sudoers state=absent regexp="^%wheel"
|
||
|
.fi
|
||
|
." ------- AUTHOR
|
||
12 years ago
|
.SH AUTHOR
|
||
|
Daniel Hokka Zakrisson
|
||
12 years ago
|
.SH SEE ALSO
|
||
|
.IR ansible (1),
|
||
|
.I http://ansible.github.com/modules.html#lineinfile
|