Bug #11963
closedPlease, legitimate "Priority" usage in multi-instance directives
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.
Updated by Benoît PECCATTE almost 7 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
Updated by François ARMAND almost 7 years ago
The semantic is now checked with an unit test so that it does not change. I will update documentation to match reality.
Updated by François ARMAND almost 7 years ago
- Status changed from New to In progress
Updated by François ARMAND almost 7 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
Updated by Rudder Quality Assistant almost 7 years ago
- Assignee changed from Nicolas CHARLES to François ARMAND
Updated by François ARMAND almost 7 years ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder-doc|c54c1493aa20ba20f0814c9a3e9e3b064bfbe279.
Updated by Vincent MEMBRÉ over 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.
- 4.1.10: Announce Changelog
- 4.2.4: Announce Changelog
- Download: https://www.rudder-project.org/site/get-rudder/downloads/