Project

General

Profile

Actions

User story #3112

closed

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

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

Added by Nicolas PERRON about 13 years ago. Updated over 6 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 CHARLESActions
Related to Rudder - User story #5449: Make environment variables accessible as parameter in all TechniquesReleasedActions
Related to Rudder - User story #5506: Customize Nodes by adding attribute on themReleasedFrançois ARMANDActions
Related to Rudder - Bug #6125: We can define key-values on nodes, but we can't use it in the directivesRejectedFrançois ARMANDActions
Related to Rudder - User story #6733: Allow Node properties to be used in directives and ncf techniquesReleasedActions
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 variablesRejectedActions
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

Updated by Nicolas PERRON about 13 years ago Actions #1

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

Updated by François ARMAND about 13 years ago Actions #2

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

Updated by Nicolas PERRON almost 13 years ago Actions #3

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

Updated by Matthieu CERDA almost 13 years ago Actions #4

  • Target version changed from 2.6.0~rc1 to 2.6.0

Updated by Jonathan CLARKE almost 13 years ago Actions #5

  • Target version changed from 2.6.0 to 2.6.1

Updated by Nicolas PERRON over 12 years ago Actions #6

  • Target version changed from 2.6.1 to 2.6.2

Updated by Nicolas PERRON over 12 years ago Actions #7

  • Target version changed from 2.6.2 to 2.6.3

Updated by Nicolas PERRON over 12 years ago Actions #8

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

Updated by François ARMAND over 11 years ago Actions #9

  • 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.

Updated by Matthieu CERDA over 11 years ago Actions #10

  • Target version changed from 140 to 3.0.0~beta1

Updated by Jonathan CLARKE about 11 years ago Actions #11

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

Updated by François ARMAND about 11 years ago Actions #12

  • 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

Updated by François ARMAND about 11 years ago Actions #13

  • Description updated (diff)

Updated by Benoît PECCATTE almost 11 years ago Actions #14

  • Category changed from 14 to Web - Config management

Updated by Benoît PECCATTE almost 11 years ago Actions #15

  • Status changed from 8 to New

Updated by Vincent MEMBRÉ almost 11 years ago Actions #16

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

Updated by Vincent MEMBRÉ over 10 years ago Actions #17

  • Target version changed from 3.1.0~rc1 to 3.1.0

Updated by Vincent MEMBRÉ over 10 years ago Actions #18

  • Target version changed from 3.1.0 to 3.1.1

Updated by Vincent MEMBRÉ over 10 years ago Actions #19

  • Target version changed from 3.1.1 to 3.1.2

Updated by Vincent MEMBRÉ over 10 years ago Actions #20

  • Target version changed from 3.1.2 to 3.1.3

Updated by Vincent MEMBRÉ over 10 years ago Actions #21

  • Target version changed from 3.1.3 to 3.1.4

Updated by Vincent MEMBRÉ over 10 years ago Actions #22

  • Target version changed from 3.1.4 to 3.1.5

Updated by Vincent MEMBRÉ about 10 years ago Actions #23

  • Target version changed from 3.1.5 to 3.1.6

Updated by Vincent MEMBRÉ about 10 years ago Actions #24

  • Target version changed from 3.1.6 to 3.1.7

Updated by Vincent MEMBRÉ almost 10 years ago Actions #25

  • Target version changed from 3.1.7 to 3.1.8

Updated by Vincent MEMBRÉ almost 10 years ago Actions #26

  • Target version changed from 3.1.8 to 3.1.9

Updated by Vincent MEMBRÉ almost 10 years ago Actions #27

  • Target version changed from 3.1.9 to 3.1.10

Updated by Vincent MEMBRÉ over 9 years ago Actions #28

  • Target version changed from 3.1.10 to 3.1.11

Updated by Vincent MEMBRÉ over 9 years ago Actions #29

  • Target version changed from 3.1.11 to 3.1.12

Updated by François ARMAND over 9 years ago Actions #30

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

Updated by Vincent MEMBRÉ over 9 years ago Actions #31

  • Target version changed from 3.1.12 to 3.1.13

Updated by Vincent MEMBRÉ over 9 years ago Actions #32

  • Target version changed from 3.1.13 to 3.1.14

Updated by Vincent MEMBRÉ over 9 years ago Actions #33

  • Target version changed from 3.1.14 to 3.1.15

Updated by Vincent MEMBRÉ over 9 years ago Actions #34

  • Target version changed from 3.1.15 to 3.1.16

Updated by Vincent MEMBRÉ over 9 years ago Actions #35

  • Target version changed from 3.1.16 to 3.1.17

Updated by François ARMAND over 9 years ago Actions #36

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

Updated by François ARMAND over 9 years ago Actions #37

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

Updated by Vincent MEMBRÉ about 9 years ago Actions #38

  • Target version changed from 3.1.17 to 3.1.18

Updated by Vincent MEMBRÉ about 9 years ago Actions #39

  • Target version changed from 3.1.18 to 3.1.19

Updated by Vincent MEMBRÉ almost 9 years ago Actions #40

  • Target version changed from 3.1.19 to 3.1.20

Updated by Vincent MEMBRÉ almost 9 years ago Actions #41

  • Target version changed from 3.1.20 to 3.1.21

Updated by François ARMAND over 8 years ago Actions #42

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

Updated by Vincent MEMBRÉ over 8 years ago Actions #43

  • Target version changed from 3.1.21 to 3.1.22

Updated by François ARMAND over 8 years ago Actions #44

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

Updated by François ARMAND over 8 years ago Actions #45

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.

Updated by Vincent MEMBRÉ over 8 years ago Actions #46

  • Target version changed from 3.1.22 to 3.1.23

Updated by Vincent MEMBRÉ over 8 years ago Actions #47

  • Target version changed from 3.1.23 to 3.1.24

Updated by Vincent MEMBRÉ over 8 years ago Actions #48

  • Target version changed from 3.1.24 to 3.1.25

Updated by Benoît PECCATTE over 8 years ago Actions #49

  • Target version changed from 3.1.25 to 4.1.9

Updated by Vincent MEMBRÉ about 8 years ago Actions #50

  • Target version changed from 4.1.9 to 4.1.10

Updated by François ARMAND about 8 years ago Actions #51

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

Updated by François ARMAND about 8 years ago Actions #52

  • Assignee deleted (François ARMAND)

Updated by Alexis Mousset over 7 years ago Actions #53

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

Updated by Nicolas CHARLES over 6 years ago Actions #54

  • 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

Updated by Nicolas CHARLES over 6 years ago Actions #55

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

Updated by Nicolas CHARLES over 6 years ago Actions #56

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

Updated by Nicolas CHARLES over 6 years ago Actions #57

  • 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

Updated by Nicolas CHARLES over 6 years ago Actions #58

  • Status changed from Pending technical review to Pending release

Updated by Nicolas CHARLES over 6 years ago Actions #59

  • Fix check set to Checked

Updated by Vincent MEMBRÉ over 6 years ago Actions #60

  • Name check set to To do

Updated by Alexis Mousset over 6 years ago Actions #61

  • Name check changed from To do to Reviewed

Updated by Vincent MEMBRÉ over 6 years ago Actions #62

  • 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: PDF Atom