CDIST-TYPE__KEY_VALUE(7) | cdist | CDIST-TYPE__KEY_VALUE(7) |
cdist-type__key_value - Change property values in files
This cdist type allows you to change values in a key value based config file.
# 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 '# my linux kernel should act as a router' # Remove existing key/value __key_value LEGACY_KEY --file /etc/somefile --state absent --delimiter '='
This type try to handle as many values as possible, so it doesn't use regexes. So you need to exactly specify the key and delimiter. Delimiter can be of any length.
Steven Armstrong <steven-cdist--@--armstrong.cc>
Copyright (C) 2011 Steven Armstrong. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
ungleich GmbH 2021
January 15, 2023 | 7.0.0 |