Project

General

Profile

User story #11618

Updated by Fran├žois ARMAND about 2 months ago

We want to have a system to be able to override node properties values (or add new ones) from the node itself, by third-party system (so the values are not managed by Rudder, just use by it).

The values would be usable only on the node, and so in techniques or if the ${node.properties[...] | node} is used.

From an implementation point of view, we propose to add a @/var/rudder/local/properties.d/@ directories on node.

External systems can put json file into it, with the same convention as node properties json file, i.e:

<pre>
{
"properties":{
"property_key1":"local node prop", &quot;property_key1&quot;:&quot;simple string value&quot;,
"property_key2":{
"more":"local node prop", &quot;more&quot;:&quot;json&quot;,
"and":"local node prop", &quot;and&quot;:&quot;even more&quot;,
},
}
}
</pre>

The agent then load node properties from @/var/rudder/cfengine-community/inputs/properties.d/@ and from @/var/rudder/local/properties.d/@, and merge them at the "properties"'s children level with local properties winning;

So if Rudder properties was:

<pre>
{
"properties":{
"property_key0":"from rudder",
"property_key1":{
"key1":"from rudder", &quot;key1&quot;:&quot;json&quot;,
&quot;key2&quot;:&quot;even more&quot;,

},
}
}
</pre>

The results would be:

<pre>
{
"properties":{
"property_key0":"from rudder",
"property_key1":"local node prop", &quot;property_key1&quot;:&quot;simple string value&quot;,
"property_key2":{
"more":"local node prop", &quot;more&quot;:&quot;json&quot;,
"and":"local node prop", &quot;and&quot;:&quot;even more&quot;,
},
}
}
</pre>

So property_key0 was kept from Rudder's node properties (because no override), property_key1 was overriden (from a json value to a string one in the example, but it's not mandatory to be it like that), and property_key2 was only present in local node property and was added to context.



Back