Project

General

Profile

Actions

User story #3112

closed

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

Added by Nicolas PERRON almost 12 years ago. Updated over 5 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Config management
Target version:
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Reviewed
Fix check:
Checked
Regression:

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 1 (0 open1 closed)

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

Related issues 11 (0 open11 closed)

Related to Rudder - User story #5278: Document allowed ${rudder.variable} in directive formResolvedActions
Related to Rudder - User story #5225: Allow to use environment variable from node inventory in directive rudder variablesReleasedNicolas CHARLES2014-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 themReleasedFrançois ARMAND2014-11-27Actions
Related to Rudder - Bug #6125: We can define key-values on nodes, but we can't use it in the directivesRejectedFrançois ARMAND2015-01-14Actions
Related to Rudder - User story #6733: Allow Node properties to be used in directives and ncf techniquesReleased2016-07-20Actions
Related to Rudder - User story #8022: Allow users to specify node hostname (FQDN)ReleasedAlexis MoussetActions
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 propertiesReleasedFrançois ARMANDActions
Related to Rudder - Bug #13671: Missing node state variable expansion in directiveReleasedFrançois ARMANDActions
Actions #1

Updated by Nicolas PERRON almost 12 years ago

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

Updated by François ARMAND almost 12 years ago

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

Updated by Nicolas PERRON over 11 years ago

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

Updated by Matthieu CERDA over 11 years ago

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

Updated by Jonathan CLARKE over 11 years ago

  • Target version changed from 2.6.0 to 2.6.1
Actions #6

Updated by Nicolas PERRON over 11 years ago

  • Target version changed from 2.6.1 to 2.6.2
Actions #7

Updated by Nicolas PERRON over 11 years ago

  • Target version changed from 2.6.2 to 2.6.3
Actions #8

Updated by Nicolas PERRON over 11 years ago

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

Updated by François ARMAND over 10 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.

Actions #10

Updated by Matthieu CERDA about 10 years ago

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

Updated by Jonathan CLARKE about 10 years ago

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

Updated by François ARMAND about 10 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
Actions #13

Updated by François ARMAND almost 10 years ago

  • Description updated (diff)
Actions #14

Updated by Benoît PECCATTE almost 10 years ago

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

Updated by Benoît PECCATTE over 9 years ago

  • Status changed from 8 to New
Actions #16

Updated by Vincent MEMBRÉ over 9 years ago

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

Updated by Vincent MEMBRÉ over 9 years ago

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

Updated by Vincent MEMBRÉ over 9 years ago

  • Target version changed from 3.1.0 to 3.1.1
Actions #19

Updated by Vincent MEMBRÉ over 9 years ago

  • Target version changed from 3.1.1 to 3.1.2
Actions #20

Updated by Vincent MEMBRÉ about 9 years ago

  • Target version changed from 3.1.2 to 3.1.3
Actions #21

Updated by Vincent MEMBRÉ about 9 years ago

  • Target version changed from 3.1.3 to 3.1.4
Actions #22

Updated by Vincent MEMBRÉ about 9 years ago

  • Target version changed from 3.1.4 to 3.1.5
Actions #23

Updated by Vincent MEMBRÉ about 9 years ago

  • Target version changed from 3.1.5 to 3.1.6
Actions #24

Updated by Vincent MEMBRÉ almost 9 years ago

  • Target version changed from 3.1.6 to 3.1.7
Actions #25

Updated by Vincent MEMBRÉ almost 9 years ago

  • Target version changed from 3.1.7 to 3.1.8
Actions #26

Updated by Vincent MEMBRÉ almost 9 years ago

  • Target version changed from 3.1.8 to 3.1.9
Actions #27

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 3.1.9 to 3.1.10
Actions #28

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 3.1.10 to 3.1.11
Actions #29

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 3.1.11 to 3.1.12
Actions #30

Updated by François ARMAND over 8 years ago

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

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 3.1.12 to 3.1.13
Actions #32

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 3.1.13 to 3.1.14
Actions #33

Updated by Vincent MEMBRÉ about 8 years ago

  • Target version changed from 3.1.14 to 3.1.15
Actions #34

Updated by Vincent MEMBRÉ about 8 years ago

  • Target version changed from 3.1.15 to 3.1.16
Actions #35

Updated by Vincent MEMBRÉ about 8 years ago

  • Target version changed from 3.1.16 to 3.1.17
Actions #36

Updated by François ARMAND about 8 years ago

  • Related to User story #8022: Allow users to specify node hostname (FQDN) added
Actions #37

Updated by François ARMAND about 8 years ago

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

Updated by Vincent MEMBRÉ about 8 years ago

  • Target version changed from 3.1.17 to 3.1.18
Actions #39

Updated by Vincent MEMBRÉ almost 8 years ago

  • Target version changed from 3.1.18 to 3.1.19
Actions #40

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 3.1.19 to 3.1.20
Actions #41

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 3.1.20 to 3.1.21
Actions #42

Updated by François ARMAND over 7 years ago

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

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 3.1.21 to 3.1.22
Actions #44

Updated by François ARMAND over 7 years ago

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

Updated by François ARMAND over 7 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.

Actions #46

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 3.1.22 to 3.1.23
Actions #47

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 3.1.23 to 3.1.24
Actions #48

Updated by Vincent MEMBRÉ about 7 years ago

  • Target version changed from 3.1.24 to 3.1.25
Actions #49

Updated by Benoît PECCATTE about 7 years ago

  • Target version changed from 3.1.25 to 4.1.9
Actions #50

Updated by Vincent MEMBRÉ about 7 years ago

  • Target version changed from 4.1.9 to 4.1.10
Actions #51

Updated by François ARMAND almost 7 years ago

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

Updated by François ARMAND almost 7 years ago

  • Assignee deleted (François ARMAND)
Actions #53

Updated by Alexis Mousset about 6 years ago

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

Updated by Nicolas CHARLES over 5 years 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
Actions #55

Updated by Nicolas CHARLES over 5 years ago

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

Updated by Nicolas CHARLES over 5 years 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

Actions #57

Updated by Nicolas CHARLES over 5 years 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
Actions #58

Updated by Nicolas CHARLES over 5 years ago

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

Updated by Nicolas CHARLES over 5 years ago

  • Fix check set to Checked
Actions #60

Updated by Vincent MEMBRÉ over 5 years ago

  • Name check set to To do
Actions #61

Updated by Alexis Mousset over 5 years ago

  • Name check changed from To do to Reviewed
Actions #62

Updated by Vincent MEMBRÉ over 5 years ago

  • Status changed from Pending release to Released

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

Actions

Also available in: Atom PDF