Project

General

Profile

Actions

User story #11618

closed

Node properties local override

Added by François ARMAND about 7 years ago. Updated almost 7 years ago.

Status:
Released
Priority:
N/A
Category:
Agent
Target version:
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Fix check:
Regression:

Description

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:

{
  "properties":{
    "property_key1":"local node prop",
    "property_key2":{
      "more":"local node prop",
      "and":"local node prop",
    },
  }
}

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:

{
  "properties":{
    "property_key0":"from rudder",
    "property_key1":{
      "key1":"from rudder",
    },
  }
}

The results would be:

{
  "properties":{
    "property_key0":"from rudder",
    "property_key1":"local node prop",
    "property_key2":{
      "more":"local node prop",
      "and":"local node prop",
    },
  }
}

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.


Subtasks 1 (0 open1 closed)

User story #11623: Create documentation on local node properties overideReleasedAlexis MoussetActions

Related issues 1 (0 open1 closed)

Related to Rudder - Bug #11703: Node properties local override does not function as one would expectReleasedNicolas CHARLESActions
Actions #1

Updated by Nicolas CHARLES about 7 years ago

Interestingly enough, the properties files are not overriding in the right order - A wins over the Z, which is exactly the opposite of what is advertised

Actions #2

Updated by Nicolas CHARLES about 7 years ago

  • Status changed from New to In progress
  • Assignee set to Nicolas CHARLES
Actions #3

Updated by Nicolas CHARLES about 7 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Nicolas CHARLES to Alexis Mousset
  • Pull Request set to https://github.com/Normation/rudder-techniques/pull/1209
Actions #4

Updated by Florian Heigl about 7 years ago

I'm not sure I understand the example well enough.
Is it really supposed to move "property_key1" to "property_key2"

That seems like a typo, otherwise it feels life threatening.

Actions #5

Updated by François ARMAND about 7 years ago

  • Description updated (diff)
Actions #6

Updated by François ARMAND about 7 years ago

@florian: I made the example clearer (I hope)

Actions #7

Updated by Nicolas CHARLES about 7 years ago

  • Status changed from Pending technical review to Pending release
Actions #8

Updated by Vincent MEMBRÉ about 7 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 4.1.8 and 4.2.1 which were released today.

Actions #9

Updated by Nicolas CHARLES about 7 years ago

  • Related to Bug #11703: Node properties local override does not function as one would expect added
Actions

Also available in: Atom PDF