Project

General

Profile

Actions

Bug #11963

closed

Please, legitimate "Priority" usage in multi-instance directives

Added by Dmitry Svyatogorov about 6 years ago. Updated about 6 years ago.

Status:
Released
Priority:
N/A
Category:
Documentation
Target version:
Severity:
Minor - inconvenience | misleading | easy workaround
UX impact:
User visibility:
Operational - other Techniques | Technique editor | Rudder settings
Effort required:
Priority:
32
Name check:
Fix check:
Regression:

Description

Please note, that https://www.rudder-project.org/doc-4.2/_directives_ordering.html is in fact incomplete.

https://www.mauras.ch/rudder-fun-with-variables.html
is exploiting undocumented fact that "Priority" field takes precedence over alpha-numeric naming order.
It's really useful together with generic_variable_definition, allowing us to make multilevel overriding (like Chef does).

It works because vars in generic_variable_definition are just internal objects, and redeclaration is ok in cfengine.

Example:

bundle common generic_variable_definition
{

  vars:
    "SECURITY_ACCESS_CONF" string => "admins",
            policy => "overridable";

…
    "SECURITY_ACCESS_CONF" string => "admins,etc",
            policy => "overridable";
…

will set generic_variable_definition.SECURITY_ACCESS_CONF = "admins,etc".

Just use another directive with higher "Priority" (0>1>…>10). And last one will be used.

  • M.b. it works with other directives, but (in general) is useless in management of external objects.
    Per contra, it's very useful to override internal declarations, providing scalar priority instead of 2-level name-sorting hell.

It's also a good workaround against single-level group hierarchy.


Subtasks 1 (0 open1 closed)

Architecture #12007: Enforce with a test the behaviour of generic_variable_definitionReleasedNicolas CHARLESActions
Actions #1

Updated by Benoît PECCATTE about 6 years ago

  • Assignee set to François ARMAND
  • Target version set to 4.1.10
  • Severity set to Minor - inconvenience | misleading | easy workaround
  • User visibility set to Operational - other Techniques | Technique editor | Rudder settings
  • Priority changed from 0 to 32
Actions #2

Updated by François ARMAND about 6 years ago

The semantic is now checked with an unit test so that it does not change. I will update documentation to match reality.

Actions #3

Updated by François ARMAND about 6 years ago

  • Status changed from New to In progress
Actions #4

Updated by François ARMAND about 6 years ago

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

Updated by Rudder Quality Assistant about 6 years ago

  • Assignee changed from Nicolas CHARLES to François ARMAND
Actions #6

Updated by François ARMAND about 6 years ago

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

Updated by Vincent MEMBRÉ about 6 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 4.1.10 and 4.2.4 which were released today.

Actions

Also available in: Atom PDF