Architecture #12028
closedArchitecture #11858: Add common pre- and post- agent run action triggered by technique logic
Missing simple quote on "Add common pre- and post- agent run action triggered by technique logic" test
Description
We would like to have some cfengine code shared between more than one version of a technique. This is needed to be able to "merge" common action like restarting a service if its config file was updated, or execute a command to get a common information.
For example we would have 3 versions of technique A :- A/v1/code.st
- A/v1/common.st
- A/v2/code.st
- A/v2/common.st
- A/v3/code.st
- A/v3/common.st
- A/v1/code.st
- A/v2/code.st
- A/v2/common.st
To generate the final content.
After some thought on it (see comments), the chosen solution is to add a notion of run-hooks implemented like that:
- in metadata.xml, we add an optionnal section in <AGENT> with the following parameters: pre or post hook, hook type (service restart, command, variable from command, package), parameters (a list of k/value), condition (a class expression)
- during generation, on a given node, we:
- accumulate pre (post) hooks which differ on type or parameters
- merge (i.e: accumulate reportid, "or" condition) hooks with same type / parameters
- we add the resulting pre (post) hooks in the bundle sequence by mapping them to the corresponding method calls
Note: reports are for all directive registering for a hook. It makes no sense to have a report for only one directive (because in that case, it is not a common code, it's some code specific to one directive that should be defined in the directive logic)
Updated by François ARMAND almost 7 years ago
- Status changed from New to In progress
- Assignee set to François ARMAND
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/pull/1841
Updated by François ARMAND almost 7 years ago
- Subject changed from Add common pre- and post- agent run action triggered by technique logic to Missing simple quote on "Add common pre- and post- agent run action triggered by technique logic" test
Updated by François ARMAND almost 7 years ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder|f635263f5a4d1af6a2d0b4bd6e523ebbc9c6779c.
Updated by Vincent MEMBRÉ almost 7 years ago
- Status changed from Pending release to Released
This bug has been fixed in Rudder 4.3.0~beta1 which was released today.
- 4.3.0~beta1: Announce Changelog
- Download: https://www.rudder-project.org/site/get-rudder/downloads/