2012-09-20 08:42:16 +00:00
|
|
|
cdist-type__line(7)
|
|
|
|
===================
|
2016-06-23 14:08:59 +00:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
|
|
|
cdist-type__line - Manage lines in files
|
2012-09-20 08:42:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
This cdist type allows you to add lines and remove lines from files.
|
|
|
|
|
|
|
|
|
|
|
|
REQUIRED PARAMETERS
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
OPTIONAL PARAMETERS
|
|
|
|
-------------------
|
2016-05-20 06:50:56 +00:00
|
|
|
state
|
2012-09-20 08:42:16 +00:00
|
|
|
'present' or 'absent', defaults to 'present'
|
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
line
|
2012-09-20 08:42:16 +00:00
|
|
|
Specifies the line which should be absent or present
|
2012-09-20 15:35:14 +00:00
|
|
|
|
2012-09-20 11:20:30 +00:00
|
|
|
Must be present, if state is present.
|
2012-09-20 15:35:14 +00:00
|
|
|
Must not be combined with regex, if state is absent.
|
2012-09-20 08:42:16 +00:00
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
regex
|
2012-09-20 15:35:14 +00:00
|
|
|
If state is present, search for this pattern and add
|
|
|
|
given line, if the given regular expression does not match.
|
|
|
|
|
|
|
|
In case of absent, ensure all lines matching the
|
2013-10-29 11:23:07 +00:00
|
|
|
regular expression are absent.
|
2012-09-20 15:35:14 +00:00
|
|
|
|
2013-10-29 11:23:07 +00:00
|
|
|
The regular expression is interpreted by grep.
|
|
|
|
|
|
|
|
Must not be combined with line, if state is absent.
|
2012-09-20 08:42:16 +00:00
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
file
|
2012-09-20 08:42:16 +00:00
|
|
|
If supplied, use this as the destination file.
|
|
|
|
Otherwise the object_id is used.
|
|
|
|
|
|
|
|
|
|
|
|
EXAMPLES
|
|
|
|
--------
|
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
# Manage the DAEMONS line in rc.conf
|
|
|
|
__line daemons --file /etc/rc.conf --line 'DAEMONS=(hwclock !network sshd crond postfix)'
|
2012-09-20 08:42:16 +00:00
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
# Ensure the home mount is present in /etc/fstab - explicitly make it present
|
|
|
|
__line home-fstab \
|
|
|
|
--file /etc/fstab \
|
|
|
|
--line 'filer.fs:/vol/home /home nfs defaults 0 0' \
|
|
|
|
--state present
|
2012-09-20 08:42:16 +00:00
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
# Removes the line specifiend in "include_www" from the file "lighttpd.conf"
|
|
|
|
__line legacy_timezone --file /etc/rc.conf --regex 'TIMEZONE=.*' --state absent
|
2012-09-20 08:42:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
2016-06-17 19:28:16 +00:00
|
|
|
grep(1)
|
|
|
|
|
|
|
|
Full documentation at: <:cdist_docs:`index`>,
|
|
|
|
especially cdist type chapter: <:cdist_docs:`cdist-type`>.
|
|
|
|
|
|
|
|
|
|
|
|
AUTHORS
|
|
|
|
-------
|
|
|
|
Nico Schottelius <nico-cdist--@--schottelius.org>
|
2012-09-20 08:42:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
COPYING
|
|
|
|
-------
|
2013-10-29 11:23:07 +00:00
|
|
|
Copyright \(C) 2012-2013 Nico Schottelius. Free use of this software is
|
2012-09-20 08:42:16 +00:00
|
|
|
granted under the terms of the GNU General Public License version 3 (GPLv3).
|