Project

General

Profile

User story #3112

Allow to get informations from the node inventory to use them in Directives and ncf techniques

Added by Nicolas PERRON almost 7 years ago. Updated 2 months ago.

Status:
Released
Priority:
N/A
Category:
Web - Config management
Target version:
Suggestion strength:
User visibility:
Effort required:

Description

We should be able to use the informations from the inventories in the Directives. This is not the case now, then we have no way to make a symlink from /usr/src/linux to /usr/src/linux-number-of-kernel, for example.

In the inventory, we have informations like:
  • Hostname
  • OS name, version, SP
  • ips
  • RAM Memory
  • Kernel Version
  • policy server id
  • local administrator name
  • architecture description
  • timezone

They be made available in JSON, and used with variable ${node.inventory}, like ${node.inventory[os][name]}

Issue is: how do we differentiate all ips (we have simply a list)


Subtasks

User story #15406: Update system technique to use new variable for inventory informationReleasedAlexis MOUSSETActions

Related issues

Related to Rudder - User story #5278: Document allowed ${rudder.variable} in directive formNewActions
Related to Rudder - User story #5225: Allow to use environment variable from node inventory in directive rudder variablesReleased2014-07-07Actions
Related to Rudder - User story #5449: Make environment variables accessible as parameter in all TechniquesReleased2014-10-14Actions
Related to Rudder - User story #5506: Customize Nodes by adding attribute on themReleased2014-11-27Actions
Related to Rudder - Bug #6125: We can define key-values on nodes, but we can't use it in the directivesRejected2015-01-14Actions
Related to Rudder - User story #6733: Allow Node properties to be used in directives and ncf techniquesReleased2016-07-20Actions
Related to Rudder - Bug #8022: Node's FQDN-Resolution is sometimes invalidNewActions
Related to Rudder - User story #4054: Special cfengine variables vs. special Rudder variablesRejected2013-10-11Actions
Related to Rudder - Question #10450: Use node inventory data in directives? With substring syntax?ResolvedActions
Related to Rudder - User story #4670: Allows inventories to be augmented by the user with custom propertiesReleasedActions
Related to Rudder - Bug #13671: Missing node state variable expansion in directiveReleasedActions

Associated revisions

Revision 7345ede6 (diff)
Added by Nicolas CHARLES 4 months ago

Fixes #3112: Allow to get informations from the node inventory to use them in Directives and ncf techniques

History

#1

Updated by Nicolas PERRON almost 7 years ago

  • Target version changed from 2.5.0~beta1 to 2.5.0~rc1
#2

Updated by François ARMAND almost 7 years ago

  • Target version changed from 2.5.0~rc1 to 2.6.0~beta1
#3

Updated by Nicolas PERRON over 6 years ago

  • Target version changed from 2.6.0~beta1 to 2.6.0~rc1
#4

Updated by Matthieu CERDA over 6 years ago

  • Target version changed from 2.6.0~rc1 to 2.6.0
#5

Updated by Jonathan CLARKE over 6 years ago

  • Target version changed from 2.6.0 to 2.6.1
#6

Updated by Nicolas PERRON over 6 years ago

  • Target version changed from 2.6.1 to 2.6.2
#7

Updated by Nicolas PERRON over 6 years ago

  • Target version changed from 2.6.2 to 2.6.3
#8

Updated by Nicolas PERRON over 6 years ago

  • Status changed from New to 8
  • Target version changed from 2.6.3 to Ideas (not version specific)
#9

Updated by François ARMAND over 5 years ago

  • Assignee set to François ARMAND
  • Target version changed from Ideas (not version specific) to 140

This is more and more a necessity.

For now, we have access to these information:
- rudder.node.id
- rudder.node.hostname
- rudder.node.admin
- rudder.node.policyserver.id
- rudder.node.policyserver.hostname
- rudder.node.policyserver.admin

Taking an iterative approach, the first step will be to get the environment variable from the enventory.
Then, the logic should be extended to ANY inventory property, following the nomenclature from what is returned by the API when asked for node details.

Question will have to be asked about how we handle multivalued or compound field in an homogeneous and systematic way. For example, we could adopt a JSON like structure.

#10

Updated by Matthieu CERDA about 5 years ago

  • Target version changed from 140 to 3.0.0~beta1
#11

Updated by Jonathan CLARKE almost 5 years ago

  • Target version changed from 3.0.0~beta1 to 3.1.0~beta1
#12

Updated by François ARMAND almost 5 years ago

  • Subject changed from We should have methods to get informations from the node inventory to use them in the Directives to Allow to get informations from the node inventory to use them in Directives
#13

Updated by François ARMAND almost 5 years ago

  • Description updated (diff)
#14

Updated by Benoît PECCATTE over 4 years ago

  • Category changed from 14 to Web - Config management
#15

Updated by Benoît PECCATTE over 4 years ago

  • Status changed from 8 to New
#16

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 3.1.0~beta1 to 3.1.0~rc1
#17

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 3.1.0~rc1 to 3.1.0
#18

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 3.1.0 to 3.1.1
#19

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 3.1.1 to 3.1.2
#20

Updated by Vincent MEMBRÉ about 4 years ago

  • Target version changed from 3.1.2 to 3.1.3
#21

Updated by Vincent MEMBRÉ about 4 years ago

  • Target version changed from 3.1.3 to 3.1.4
#22

Updated by Vincent MEMBRÉ about 4 years ago

  • Target version changed from 3.1.4 to 3.1.5
#23

Updated by Vincent MEMBRÉ almost 4 years ago

  • Target version changed from 3.1.5 to 3.1.6
#24

Updated by Vincent MEMBRÉ almost 4 years ago

  • Target version changed from 3.1.6 to 3.1.7
#25

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 3.1.7 to 3.1.8
#26

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 3.1.8 to 3.1.9
#27

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 3.1.9 to 3.1.10
#28

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 3.1.10 to 3.1.11
#29

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 3.1.11 to 3.1.12
#30

Updated by François ARMAND over 3 years ago

  • Related to User story #6733: Allow Node properties to be used in directives and ncf techniques added
#31

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 3.1.12 to 3.1.13
#32

Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 3.1.13 to 3.1.14
#33

Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 3.1.14 to 3.1.15
#34

Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 3.1.15 to 3.1.16
#35

Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 3.1.16 to 3.1.17
#36

Updated by François ARMAND about 3 years ago

  • Related to Bug #8022: Node's FQDN-Resolution is sometimes invalid added
#37

Updated by François ARMAND about 3 years ago

  • Related to User story #4054: Special cfengine variables vs. special Rudder variables added
#38

Updated by Vincent MEMBRÉ almost 3 years ago

  • Target version changed from 3.1.17 to 3.1.18
#39

Updated by Vincent MEMBRÉ almost 3 years ago

  • Target version changed from 3.1.18 to 3.1.19
#40

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 3.1.19 to 3.1.20
#41

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 3.1.20 to 3.1.21
#42

Updated by François ARMAND over 2 years ago

  • Related to Question #10450: Use node inventory data in directives? With substring syntax? added
#43

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 3.1.21 to 3.1.22
#44

Updated by François ARMAND over 2 years ago

  • Related to User story #4670: Allows inventories to be augmented by the user with custom properties added
#45

Updated by François ARMAND over 2 years ago

Devlopper note: there is twi hard problems,

1/ semantic to describe access to inventory values (it could be linked to #9299 if we actually model all inventory information has json path, and we will need to do that to let the user know what to query)
2/ performance and consistency

For this one, the problem is to load the correct "context" for the node in an atomic way (i.e in a way that the node context matches the directive for the same generation trigger).

To be clearer, today we have a very simple "atomic" way of doing that thing: at start of generation, we load all datas (rules, groupes, directives, parameters, and node properties) and we only rely on these loaded, immutable data for the remaining of the process.

Now, if we want to do the same with inventories, we are going to load FAR TO MUCH data, and the performance will be horrible.
So we need to somehow know before loading node information, for all node, the bounding context (aka the list of free variable for that node's applied directives), and only query for that (open question: node by node, or for all node ? Depends on node by node generation ?).

So we need to change our model, to have for each node the list of its free variable. But we can't have that today before quite far in the generation process, and we are bounding them with the node context in the same step (not clever). Quite a big change to forsee.

#46

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 3.1.22 to 3.1.23
#47

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 3.1.23 to 3.1.24
#48

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 3.1.24 to 3.1.25
#49

Updated by Benoît PECCATTE about 2 years ago

  • Target version changed from 3.1.25 to 4.1.9
#50

Updated by Vincent MEMBRÉ almost 2 years ago

  • Target version changed from 4.1.9 to 4.1.10
#51

Updated by François ARMAND almost 2 years ago

  • Target version changed from 4.1.10 to Ideas (not version specific)
#52

Updated by François ARMAND almost 2 years ago

  • Assignee deleted (François ARMAND)
#53

Updated by Alexis MOUSSET about 1 year ago

  • Related to Bug #13671: Missing node state variable expansion in directive added
#54

Updated by Nicolas CHARLES 4 months ago

  • Subject changed from Allow to get informations from the node inventory to use them in Directives to Allow to get informations from the node inventory to use them in Directives and ncf techniques
  • Description updated (diff)
  • Target version changed from Ideas (not version specific) to 5.0.13
#55

Updated by Nicolas CHARLES 4 months ago

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

Updated by Nicolas CHARLES 4 months ago

It generates a JSON

{
  "hostname":"server.rudder.local",
  "policyServerId":"root",
  "localAdministratorAccountName":"root",
  "archDescription":"x86_64",
  "ram":"1572864000",
  "timezone":"Europe/Paris",
  "os":{
    "name":"Debian",
    "fullName":"Debian GNU/Linux 9.1 (stretch)",
    "version":"9.1",
    "kernelVersion":"4.9.0-3-amd64",
    "servicePack":"" 
  },
  "machine":{
    "machineType":"VirtualMachineType(VirtualBox)",
    "manufacturer":"innotek GmbH" 
  }
}

in Rudder System Variable RUDDER_INVENTORY_VARS

#57

Updated by Nicolas CHARLES 4 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Nicolas CHARLES to François ARMAND
  • Pull Request set to https://github.com/Normation/rudder/pull/2374
#58

Updated by Nicolas CHARLES 4 months ago

  • Status changed from Pending technical review to Pending release
#62

Updated by Vincent MEMBRÉ 2 months ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 5.0.13 which was released today.

Also available in: Atom PDF