.\" Man page generated from reStructuredText. . .TH "CDIST-TYPE__LINE" "7" "Feb 16, 2019" "4.10.6" "cdist" . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH NAME .sp cdist\-type__line \- Manage lines in files .SH DESCRIPTION .sp This cdist type allows you to add lines and remove lines from files. .SH REQUIRED PARAMETERS .sp None. .SH OPTIONAL PARAMETERS .INDENT 0.0 .TP .B after Insert the given line after this pattern. .TP .B before Insert the given line before this pattern. .TP .B file If supplied, use this as the destination file. Otherwise the object_id is used. .TP .B line Specifies the line which should be absent or present. .sp Must be present, if state is \(aqpresent\(aq. Ignored if regex is given and state is \(aqabsent\(aq. .TP .B regex If state is \(aqpresent\(aq, search for this pattern and if it matches add the given line. .sp If state is \(aqabsent\(aq, ensure all lines matching the regular expression are absent. .sp The regular expression is interpreted by awk\(aqs match function. .TP .B state \(aqpresent\(aq or \(aqabsent\(aq, defaults to \(aqpresent\(aq .UNINDENT .SH BOOLEAN PARAMETERS .sp None. .SH MESSAGES .INDENT 0.0 .TP .B added The line was added. .TP .B updated The line or its position was changed. .TP .B removed The line was removed. .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # Manage a hosts entry for www.example.com. __line /etc/hosts \e \-\-line \(aq127.0.0.2 www.example.com\(aq # Manage another hosts entry for test.example.com. __line hosts:test.example.com \e \-\-file /etc/hosts \e \-\-line \(aq127.0.0.3 test.example.com\(aq # Remove the line starting with TIMEZONE from the /etc/rc.conf file. __line legacy_timezone \e \-\-file /etc/rc.conf \e \-\-regex \(aqTIMEZONE=.*\(aq \e \-\-state absent # Insert a line before another one. __line password\-auth\-local:classify \e \-\-file /etc/pam.d/password\-auth\-local \e \-\-line \(aq\-session required pam_exec.so debug log=/tmp/classify.log /usr/local/libexec/classify\(aq \e \-\-before \(aq^session[[:space:]]+include[[:space:]]+password\-auth\-ac$\(aq # Insert a line after another one. __line password\-auth\-local:classify \e \-\-file /etc/pam.d/password\-auth\-local \e \-\-line \(aq\-session required pam_exec.so debug log=/tmp/classify.log /usr/local/libexec/classify\(aq \e \-\-after \(aq^session[[:space:]]+include[[:space:]]+password\-auth\-ac$\(aq .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .sp \fBcdist\-type\fP(7) .SH AUTHORS .sp Steven Armstrong <\fI\%steven\-cdist\-\-@\-\-armstrong.cc\fP> .SH COPYING .sp Copyright (C) 2018 Steven Armstrong. Free use of this software is granted under the terms of the GNU General Public License version 3 (GPLv3). .\" Generated by docutils manpage writer. .