Project

General

Profile

Actions

User story #2585

closed

Synchronize the rootServerInitialPromises automatically (or at least the distributePolicy part) with the regular Rudder technique tree

Added by Matthieu CERDA almost 12 years ago. Updated about 7 years ago.

Status:
Rejected
Priority:
3
Assignee:
-
Category:
System techniques
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Fix check:
Regression:

Description

Synchronize the rootServerInitialPromises automatically (or at least the distributePolicy part) with the regular Rudder Technique tree,

We should be able using a simple tool (script or other) to automatically synchronize the server initial promises with the Rudder Techniques tree, saving us lots of time wasted doing it manually.

Actions #1

Updated by Matthieu CERDA almost 12 years ago

  • Assignee deleted (Jonathan CLARKE)
Actions #2

Updated by Matthieu CERDA almost 12 years ago

Voici la procédure que j'ai suivie pour mettre a jour les distributePolicies:

  • Copier tous les .st de l'arbre des Techniques en tant que .cf dans les promesses initiales
  • Lancer ces commandes dessus:
    for i in *.cf; do sed -i 's%@@DistributePolicy@@result_repaired@@.*@#%@@DistributePolicy@@Repaired@@root-DP#@root-distributePolicy##$(g.uuid)@#%g' $i; done
    for i in *.cf; do sed -i 's%@@DistributePolicy@@result_success@@.*@#%@@DistributePolicy@@Success@@root-DP#@root-distributePolicy##$(g.uuid)@#%g' $i; done
    for i in *.cf; do sed -i 's%@@DistributePolicy@@result_error@@.*@#%@@DistributePolicy@@Error@@root-DP#@root-distributePolicy##$(g.uuid)@#%g' $i; done
    for i in *.cf; do sed -i 's%@@DistributePolicy@@log_repaired@@.*@#%@@DistributePolicy@@Repaired@@root-DP#@root-distributePolicy##$(g.uuid)@#%g' $i; done
    for i in *.cf; do sed -i 's%@@DistributePolicy@@log_info@@.*@#%@@DistributePolicy@@Inform@@root-DP#@root-distributePolicy##$(g.uuid)@#%g' $i; done
    for i in *.cf; do sed -i 's%@@DistributePolicy@@log_warn@@.*@#%@@DistributePolicy@@Warn@@root-DP#@root-distributePolicy##$(g.uuid)@#%g' $i; done
    for i in *.cf; do sed -i 's%@@DistributePolicy@@log_error@@.*@#%@@DistributePolicy@@Error@@root-DP#@root-distributePolicy##$(g.uuid)@#%g' $i; done
    
  • Vérifier que la bundlesequence est OK. J'ai été obligé de le faire a la main...
  • Vérifier dans le metadata.xml qu'il n'y a pas de transformations de fichier a faire.
Actions #3

Updated by Jonathan CLARKE almost 12 years ago

  • Status changed from New to Discussion
  • Assignee set to Matthieu CERDA

Er, first things first: the language in this bugtracker is English. Please translate your comment.

Secondly, I think your main worry here is one of "how to do it" more than "we must automate it".

The way I do it: add my distributePolicy Technique to Rudder, Reload Techniques, regenerate the CFEngine rules. Then go into /var/rudder/cfengine-community/inputs/ and copy the relevant files. Sure, the bundlesequence needs updating too, but you can also pretty much just copy/paste the relevant part from the generated promises.cf. This is documented (briefly, I admit, but still) in https://github.com/Normation/rudder-techniques/tree/master/initial-promises/rootServerInitialPromises.

I don't understand your sed lines to replace things like "log_error" with "Error". Please explain? Reporting really doesn't matter in initial promises - it's not sent anywhere.

Am I missing something or is this really quite easy?

Actions #4

Updated by Matthieu CERDA almost 12 years ago

Ok, I'll translate the first comment right away.

I was not aware we had a procedure to do that.

About the sed lines, it is simple: I am always taught to make new things isofunctionnal with the previous ones unless a change is necessary, so I kept the old reporting format that was present in the old initial promises. I think it would be kind of dirty to have a specific host UUID in a initial promises reporting ... (the one that would be inserted during a promise generation before the copy).

Yes, doing it the way you are proposing is quite easy indeed. Maybe I am a bit too picky.

Actions #5

Updated by Matthieu CERDA almost 12 years ago

  • Assignee changed from Matthieu CERDA to Jonathan CLARKE
Actions #6

Updated by Matthieu CERDA almost 12 years ago

First comment translation:

Here is the procedure I followed to update the distributePolicies:

  • Copy every .st file from the Techniques tree as .cf files into the initial promises
  • Launch these commands:
    for i in *.cf; do sed -i 's%@@DistributePolicy@@result_repaired@@.*@#%@@DistributePolicy@@Repaired@@root-DP#@root-distributePolicy##$(g.uuid)@#%g' $i; done
    for i in *.cf; do sed -i 's%@@DistributePolicy@@result_success@@.*@#%@@DistributePolicy@@Success@@root-DP#@root-distributePolicy##$(g.uuid)@#%g' $i; done
    for i in *.cf; do sed -i 's%@@DistributePolicy@@result_error@@.*@#%@@DistributePolicy@@Error@@root-DP#@root-distributePolicy##$(g.uuid)@#%g' $i; done
    for i in *.cf; do sed -i 's%@@DistributePolicy@@log_repaired@@.*@#%@@DistributePolicy@@Repaired@@root-DP#@root-distributePolicy##$(g.uuid)@#%g' $i; done
    for i in *.cf; do sed -i 's%@@DistributePolicy@@log_info@@.*@#%@@DistributePolicy@@Inform@@root-DP#@root-distributePolicy##$(g.uuid)@#%g' $i; done
    for i in *.cf; do sed -i 's%@@DistributePolicy@@log_warn@@.*@#%@@DistributePolicy@@Warn@@root-DP#@root-distributePolicy##$(g.uuid)@#%g' $i; done
    for i in *.cf; do sed -i 's%@@DistributePolicy@@log_error@@.*@#%@@DistributePolicy@@Error@@root-DP#@root-distributePolicy##$(g.uuid)@#%g' $i; done
    
  • Check if the bundlesequence is OK.
  • Check in the metadata.xml if there is no transformation to do.
Actions #7

Updated by Jonathan CLARKE almost 12 years ago

  • Status changed from Discussion to New
  • Assignee deleted (Jonathan CLARKE)
  • Target version changed from 24 to Ideas (not version specific)

Matthieu CERDA wrote:

Ok, I'll translate the first comment right away.

I was not aware we had a procedure to do that.

A simple question would have sufficed, rather than a long rant ;)

About the sed lines, it is simple: I am always taught to make new things isofunctionnal with the previous ones unless a change is necessary, so I kept the old reporting format that was present in the old initial promises. I think it would be kind of dirty to have a specific host UUID in a initial promises reporting ... (the one that would be inserted during a promise generation before the copy).

Understood. In this case, the node ID is "root", for rootServerInitialPromises, and that's fine.

I'll leave this ticket open, but not for 2.5, since as this discussion has shown the manual way is not that hard.

Actions #8

Updated by Alexis Mousset about 7 years ago

  • Status changed from New to Rejected

Initial promises have been merged into the main technique tree (#7915), closing.

Actions

Also available in: Atom PDF