78 lines
2.1 KiB
Text
78 lines
2.1 KiB
Text
cdist-type__key_value(7)
|
|
========================
|
|
Steven Armstrong <steven-cdist--@--armstrong.cc>
|
|
|
|
|
|
NAME
|
|
----
|
|
cdist-type__key_value - Change property values in files
|
|
|
|
|
|
DESCRIPTION
|
|
-----------
|
|
This cdist type allows you to change values in a key value based config
|
|
file.
|
|
|
|
|
|
REQUIRED PARAMETERS
|
|
-------------------
|
|
file::
|
|
The file to operate on.
|
|
delimiter::
|
|
The delimiter which seperates the key from the value.
|
|
|
|
|
|
OPTIONAL PARAMETERS
|
|
-------------------
|
|
state::
|
|
present or absent, defaults to present. If present, sets the key to value,
|
|
if absent, removes the key from the file.
|
|
key::
|
|
The key to change. Defaults to object_id.
|
|
value::
|
|
The value for the key. Optional if state=absent, required otherwise.
|
|
comment_line::
|
|
If supplied, the comment line is inserted before the line with key and value,
|
|
but only if key or value is about to be changed.
|
|
|
|
|
|
EXAMPLES
|
|
--------
|
|
|
|
--------------------------------------------------------------------------------
|
|
# Set the maximum system user id
|
|
__key_value SYS_UID_MAX --file /etc/login.defs --value 666 --delimiter ' '
|
|
|
|
# Same with fancy id
|
|
__key_value my-fancy-id --file /etc/login.defs --key SYS_UID_MAX --value 666 \
|
|
--delimiter ' '
|
|
|
|
# Enable packet forwarding
|
|
__key_value net.ipv4.ip_forward --file /etc/sysctl.conf --value 1 \
|
|
--delimiter ' = ' --comment_line '# my linux kernel should act as a router'
|
|
|
|
# Remove existing key/value
|
|
__key_value LEGACY_KEY --file /etc/somefile --state absent --delimiter '='
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
MORE INFORMATION
|
|
----------------
|
|
This type does not use regex to avoid quoting problems.
|
|
So you need to specify the key and delimiteri exactly.
|
|
Delimiter can be one or more characters.
|
|
Due to shell limitations, we have some values which can not be used.
|
|
These values are:
|
|
__CDIST_HEREDOC_END_HERE_MARKER
|
|
__CDIST_INPUT_END_HERE_MARKER
|
|
|
|
|
|
SEE ALSO
|
|
--------
|
|
- cdist-type(7)
|
|
|
|
|
|
COPYING
|
|
-------
|
|
Copyright \(C) 2011 Steven Armstrong. Free use of this software is
|
|
granted under the terms of the GNU General Public License version 3 (GPLv3).
|