[rudder-users] order of application

Nicolas Charles nicolas.charles at normation.com
Tue Sep 4 09:23:49 CEST 2012


On 03/09/2012 11:25, Michael Gliwinski wrote:
> On Monday 03 Sep 2012 10:16:04 Nicolas Charles wrote:
>> On 03/09/2012 10:06, Michael Gliwinski wrote:
>>> A quick question.  Is there a way to affect the order in which
>>> directives are applied?  Or the order in generated bundlesequence?
>> So far, there is no way to affect the order of application of
>> directives. However, it is something we'd like to implement in Rudder.
>> We are wondering how it should (could?) be defined in the WebUI, and are
>> open to suggestions !
> I guess the most useful thing would be to have it as part of rule management
> to allow re-ordering individual directives (e.g. a list with up/down buttons,
> drag&  drop, etc.), however AFAICS this may not be so easy to do.
That sounds like a nice idea ! Thanks
CFEngine 3.4 introduces "depends_on" that now is used to manage 
dependencies. It would make sense to benefit from it
>
> AFAICS you can already affect ordering of directives within a given type with
> the 'Priority' property (e.g. to affect which 'Enforce a file content' directive
> is applied first).  Is that correct?
The priority will order only directives based on same techniques (or 
define which directive will be used if several unique based on the same 
technique are applied to a node)

>
> I'm not actually sure if it would be useful to expose global ordering of
> directive types (i.e. bundlesequence), possibly a better default would work OK
> here.
>
>>> The specific issue I'm having now is that I have an RPM package
>>> installation directive and a checkGenericFileContent directive for
>>> updating a configuration file installed by the package.  The problem is
>>> that checkGenericFileContent is before rpmPackageInstallation in the
>>> bundlesequence, so on first installation the config file is created by
>>> CFe before the package is installed, which causes RPM to install the
>>> config file as an .rpmnew file.
> E.g. for this case, changing bundlesequence to do package installation before
> manageFilesAndFolders and check_generic_file_content would work fine, the
> downside is it introduces a problem when checkGenericFileContent is used to
> modify configuration of the package manager itself.
>
> Do you think this is a rather common case?

I guess generalizing this order might have some issue, as users might 
not expect it.
But it is a rather common use case to install a package and then edit 
files for the install packages. Maybe having a "manage packages and then 
manage files" technique would be of some use ?

Nicolas


More information about the rudder-users mailing list