Project

General

Profile

« Previous | Next » 

Revision e0805848

Added by Nicolas CHARLES over 6 years ago

Fixes #11623: Create documentation on local node properties overide

View differences:

42_advanced_configuration_management/40_node_properties.txt
Node properties can be modified using Rudder's API, see http://www.rudder-project.org/rudder-api-doc/#api-Nodes-updateNodeProperties
Properties can also be defined on the node itself, to override locally properties.
Each property is a key=value pair. The value can be a string or a well-formatted JSON data structure.
Some examples:
......
----
==== Local override
The agent searches for optionnal properties files `/var/rudder/local/properties.d/*.json`, and will override existing properties.
As a result, if you have node properties defined server side as
`"sysctls_postgresql":{"kernel.shmall":"903330","kernel.shmmax":"3700041320"}` and
`"vm":{"vm.dirty_ratio":"10"}`
and a local property file `/var/rudder/local/properties.d/postgresql_config.json` as
----
{
"properties":
{
"sysctls_postgresql": {
"kernel.shmmax":"5368709120"
}
}
}
----
The resulting properties will be:
`"sysctls_postgresql":{"kernel.shmmax":"5368709120"}` and
`"vm":{"vm.dirty_ratio":"10"}`
`sysctls_postgresql` has been overriden by local property, and `vm` has been left untouched
==== Under the hood
On the server, one or more properties files are written for each node in the
......
`/var/rudder/cfengine-community/inputs/properties/*.json`. All files are taken
in order and override the previous ones - the last one wins.
The agent searches for optionnal properties files `/var/rudder/local/properties.d/*.json`, and will define variables
or override existing properties.
Each file must contain at least 2 levels of JSON content, the first level is the namespace level
and the second level is the key level.
42_advanced_configuration_management/45_node_properties_in_directives.txt
Properties on nodes are defined using Rudder's REST API, with the 'Update Node properties' API call.
More details in our http://www.rudder-project.org/rudder-api-doc[API documentation].
Properties can also be defined directly on the nodes, by creating properties files
`/var/rudder/local/properties.d/*.json/`
==== Feature availability
This feature was introduced in Rudder 3.1.14, Rudder 3.2.7 and Rudder 4.0.0.
......
Which will be considered as a standard variable by the agent, which will replaced this expression by its value if it's defined, or kept as is if it's unknown.
The variable is content is read from /var/rudder/cfengine-community/inputs/properties.d/properties.json.
The variable content is read from `/var/rudder/cfengine-community/inputs/properties.d/properties.json`, and from the optionally defined `/var/rudder/local/properties.d/*.json` files.
You can find more information on node properties in <<_node_properties>>.

Also available in: Unified diff