Project

General

Profile

Actions

Architecture #12028

closed

Architecture #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

Added by François ARMAND almost 7 years ago. Updated almost 7 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Config management
Target version:
Effort required:
Name check:
Fix check:
Regression:

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
If both v1 and v2 are used, the generator would use :
  • 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)

Actions #1

Updated by François ARMAND almost 7 years ago

  • Status changed from New to In progress
  • Assignee set to François ARMAND
Actions #2

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
Actions #3

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
Actions #4

Updated by François ARMAND almost 7 years ago

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

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.

Actions

Also available in: Atom PDF